about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-03-08 18:17:08 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-03-08 18:17:08 +0100
commit3937fc4b7172d69e6573ca8756a0b6824d460cbf (patch)
tree48306f6aa51b3cb93b5296af0d5ecf787814e99a
parent5debac4c98c1c5c262f5cae3f0cdee8527ef06a6 (diff)
downloadbox64-3937fc4b7172d69e6573ca8756a0b6824d460cbf.tar.gz
box64-3937fc4b7172d69e6573ca8756a0b6824d460cbf.zip
[DYNAREC] Small changeon the critical section handling of custommem
-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)