about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/box64context.h5
-rw-r--r--src/include/custommem.h4
-rwxr-xr-xsrc/include/threads.h3
3 files changed, 12 insertions, 0 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h
index ffcacc36..4d48c816 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -200,4 +200,9 @@ int AddTLSPartition(box64context_t* context, int tlssize);
 void thread_set_emu(x64emu_t* emu);
 x64emu_t* thread_get_emu();
 
+// unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex
+int unlockMutex();
+// relock the muxtex that were unlocked
+void relockMutex(int locks);
+
 #endif //__BOX64CONTEXT_H_
diff --git a/src/include/custommem.h b/src/include/custommem.h
index 15f38596..1b86d251 100644
--- a/src/include/custommem.h
+++ b/src/include/custommem.h
@@ -52,6 +52,10 @@ void unlockDB();
 void* find32bitBlock(size_t size);
 void* findBlockNearHint(void* hint, size_t size);
 
+// unlock mutex that are locked by current thread (for signal handling). Return a mask of unlock mutex
+int unlockCustommemMutex();
+// relock the muxtex that were unlocked
+void relockCustommemMutex(int locks);
 
 void init_custommem_helper(box64context_t* ctx);
 void fini_custommem_helper(box64context_t* ctx);
diff --git a/src/include/threads.h b/src/include/threads.h
index fa9d64ab..19d3c9bc 100755
--- a/src/include/threads.h
+++ b/src/include/threads.h
@@ -20,4 +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);
 
+//check if a mutex is locked by current thread (works only for PTHREAD_MUTEX_ERRORCHECK typed mutex)
+int checkMutex(void* m);
+
 #endif //_THREADS_H_
\ No newline at end of file