diff options
Diffstat (limited to 'src/include')
| -rwxr-xr-x | src/include/box64context.h | 15 | ||||
| -rwxr-xr-x | src/include/threads.h | 2 |
2 files changed, 14 insertions, 3 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) diff --git a/src/include/threads.h b/src/include/threads.h index d094dc0b..847d4ee6 100755 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -20,9 +20,7 @@ void fini_pthread_helper(box64context_t* context); // prepare an "emuthread structure" in pet and return address of function pointer for a "thread creation routine" void* my_prepare_thread(x64emu_t *emu, void* f, void* arg, int ssize, void** pet); -#ifndef DYNAREC //check and unlock if a mutex is locked by current thread (works only for PTHREAD_MUTEX_ERRORCHECK typed mutex) int checkUnlockMutex(void* m); -#endif #endif //_THREADS_H_ \ No newline at end of file |