about summary refs log tree commit diff stats
path: root/src/include/box64context.h
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-05-07 14:12:16 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-05-07 14:12:16 +0200
commit3221038bc664158431f64b491800f56955044d91 (patch)
tree62506b19bd7f83b2d489992ca50c22408540c9f5 /src/include/box64context.h
parent0359a65a00cbabee67515f53cf58ed7bc894e0ee (diff)
downloadbox64-3221038bc664158431f64b491800f56955044d91.tar.gz
box64-3221038bc664158431f64b491800f56955044d91.zip
[DYNAREC] Disabled custom mutex for now
Diffstat (limited to 'src/include/box64context.h')
-rwxr-xr-xsrc/include/box64context.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h
index 3fe285dc..bda5bf23 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -8,6 +8,11 @@
 #include "dynarec/native_lock.h"
 #endif
 
+#ifdef DYNAREC
+// disabling for now, seems to have a negative impact on performances
+//#define USE_CUSTOM_MUTEX
+#endif
+
 typedef struct elfheader_s elfheader_t;
 typedef struct cleanup_s cleanup_t;
 typedef struct x64emu_s x64emu_t;
@@ -129,11 +134,19 @@ typedef struct box64context_s {
     pthread_mutex_t     mutex_thread;
     pthread_mutex_t     mutex_bridge;
     #else
+    #ifdef USE_CUSTOM_MUTEX
     uint32_t            mutex_dyndump;
     uint32_t            mutex_trace;
     uint32_t            mutex_tls;
     uint32_t            mutex_thread;
     uint32_t            mutex_bridge;
+    #else
+    pthread_mutex_t     mutex_dyndump;
+    pthread_mutex_t     mutex_trace;
+    pthread_mutex_t     mutex_tls;
+    pthread_mutex_t     mutex_thread;
+    pthread_mutex_t     mutex_bridge;
+    #endif
     uintptr_t           max_db_size;    // the biggest (in x86_64 instructions bytes) built dynablock
     int                 trace_dynarec;
     pthread_mutex_t     mutex_lock;     // this is for the Test interpreter
@@ -192,7 +205,7 @@ typedef struct box64context_s {
 
 } box64context_t;
 
-#ifndef DYNAREC
+#ifndef USE_CUSTOM_MUTEX
 #define mutex_lock(A)       pthread_mutex_lock(A)
 #define mutex_trylock(A)    pthread_mutex_trylock(A)
 #define mutex_unlock(A)     pthread_mutex_unlock(A)