about summary refs log tree commit diff stats
path: root/src/box64context.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-05 11:35:27 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-05 11:35:27 +0200
commitc3cd14f3c529d75de5130facc3542f4a0f56d7f9 (patch)
treed936a68ddb784f69511274c139848feba67bf9bc /src/box64context.c
parent2010f8dcce4349e1420755a94f9af2211e9574c8 (diff)
downloadbox64-c3cd14f3c529d75de5130facc3542f4a0f56d7f9.tar.gz
box64-c3cd14f3c529d75de5130facc3542f4a0f56d7f9.zip
Removed mutex per bridge and use a global one (remove chance of freeze on fork)
Diffstat (limited to 'src/box64context.c')
-rwxr-xr-xsrc/box64context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/box64context.c b/src/box64context.c
index c3b228e6..5dc64825 100755
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -88,6 +88,7 @@ int unlockMutex()
     #endif
     GO(my_context->mutex_tls, 9)
     GO(my_context->mutex_thread, 10)
+    GO(my_context->mutex_bridge, 11)
     #undef GO
 
     return ret;
@@ -110,6 +111,7 @@ void relockMutex(int locks)
     #endif
     GO(my_context->mutex_tls, 9)
     GO(my_context->mutex_thread, 10)
+    GO(my_context->mutex_bridge, 11)
     #undef GO
 }
 
@@ -128,6 +130,7 @@ static void init_mutexes(box64context_t* context)
 #endif
     pthread_mutex_init(&context->mutex_tls, &attr);
     pthread_mutex_init(&context->mutex_thread, &attr);
+    pthread_mutex_init(&context->mutex_bridge, &attr);
 
     pthread_mutexattr_destroy(&attr);
 }
@@ -268,6 +271,7 @@ void FreeBox64Context(box64context_t** context)
 #endif
     pthread_mutex_destroy(&ctx->mutex_tls);
     pthread_mutex_destroy(&ctx->mutex_thread);
+    pthread_mutex_destroy(&ctx->mutex_bridge);
 
     free_neededlib(&ctx->neededlibs);