We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ee4f89f commit c95aa47Copy full SHA for c95aa47
1 file changed
Foundation/include/Poco/Mutex_POSIX.h
@@ -22,6 +22,7 @@
22
#include "Poco/Exception.h"
23
#include <pthread.h>
24
#include <errno.h>
25
+#include <signal.h>
26
27
28
namespace Poco {
@@ -40,6 +41,7 @@ class Foundation_API MutexImpl
40
41
42
private:
43
pthread_mutex_t _mutex;
44
+ sigset_t set, oldset;
45
};
46
47
@@ -56,6 +58,8 @@ class Foundation_API FastMutexImpl: public MutexImpl
56
58
//
57
59
inline void MutexImpl::lockImpl()
60
{
61
+ sigfillset(&set);
62
+ pthread_sigmask(SIG_BLOCK, &set, &oldset);
63
if (pthread_mutex_lock(&_mutex))
64
throw SystemException("cannot lock mutex");
65
}
@@ -77,6 +81,7 @@ inline void MutexImpl::unlockImpl()
77
81
78
82
if (pthread_mutex_unlock(&_mutex))
79
83
throw SystemException("cannot unlock mutex");
84
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
80
85
86
87
0 commit comments