File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 2222#include " Poco/Exception.h"
2323#include < pthread.h>
2424#include < errno.h>
25+ #include < signal.h>
2526
2627
2728namespace Poco {
@@ -40,6 +41,7 @@ class Foundation_API MutexImpl
4041
4142private:
4243 pthread_mutex_t _mutex;
44+ sigset_t set, oldset;
4345};
4446
4547
@@ -56,6 +58,8 @@ class Foundation_API FastMutexImpl: public MutexImpl
5658//
5759inline void MutexImpl::lockImpl ()
5860{
61+ sigfillset (&set);
62+ pthread_sigmask (SIG_BLOCK, &set, &oldset);
5963 if (pthread_mutex_lock (&_mutex))
6064 throw SystemException (" cannot lock mutex" );
6165}
@@ -77,6 +81,7 @@ inline void MutexImpl::unlockImpl()
7781{
7882 if (pthread_mutex_unlock (&_mutex))
7983 throw SystemException (" cannot unlock mutex" );
84+ pthread_sigmask (SIG_SETMASK, &oldset, NULL );
8085}
8186
8287
You can’t perform that action at this time.
0 commit comments