about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/custommem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/custommem.c b/src/custommem.c
index fd22929d..3055a1ef 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -375,12 +375,13 @@ static sigset_t     critical_prot = {0};
 #define UNLOCK_PROT()       if(defered_prot_p) {                                \
                                 uintptr_t p = defered_prot_p; size_t sz = defered_prot_sz; uint32_t prot = defered_prot_prot; \
                                 defered_prot_p = 0;                             \
+                                pthread_sigmask(SIG_SETMASK, &old_sig, NULL);   \
                                 mutex_unlock(&mutex_prot);                      \
                                 setProtection(p, sz, prot);                     \
                             } else {                                            \
+                                pthread_sigmask(SIG_SETMASK, &old_sig, NULL);   \
                                 mutex_unlock(&mutex_prot);                      \
-                            }                                                   \
-                            pthread_sigmask(SIG_SETMASK, &old_sig, NULL)
+                            }
 #define UNLOCK_PROT_READ()  mutex_unlock(&mutex_prot); pthread_sigmask(SIG_SETMASK, &old_sig, NULL)