about summary refs log tree commit diff stats
path: root/src/libtools/threads.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-07-08 17:21:49 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-07-08 17:21:49 +0200
commitab2d68ef45c729134d92e9dad0d78c1fa035a489 (patch)
treebd8d00b0d7367eb2523f0abde9ff7b00ba547740 /src/libtools/threads.c
parentb7a2d59a61809739f86c2840294adb000a40f38f (diff)
downloadbox64-ab2d68ef45c729134d92e9dad0d78c1fa035a489.tar.gz
box64-ab2d68ef45c729134d92e9dad0d78c1fa035a489.zip
Simplyfied internal jmpbuf handling
Diffstat (limited to 'src/libtools/threads.c')
-rwxr-xr-xsrc/libtools/threads.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index c2c6dfb1..d70851f6 100755
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -1066,28 +1066,6 @@ EXPORT int my_pthread_barrier_init(x64emu_t* emu, pthread_barrier_t* bar, my_bar
 
 #endif
 
-static void emujmpbuf_destroy(void* p)
-{
-	emu_jmpbuf_t *ej = (emu_jmpbuf_t*)p;
-	if(ej) {
-		box_free(ej->jmpbuf);
-		box_free(ej);
-	}
-}
-
-static pthread_key_t jmpbuf_key;
-
-emu_jmpbuf_t* GetJmpBuf()
-{
-	emu_jmpbuf_t *ejb = (emu_jmpbuf_t*)pthread_getspecific(jmpbuf_key);
-	if(!ejb) {
-		ejb = (emu_jmpbuf_t*)box_calloc(1, sizeof(emu_jmpbuf_t));
-		ejb->jmpbuf = box_calloc(1, sizeof(struct __jmp_buf_tag));
-		pthread_setspecific(jmpbuf_key, ejb);
-	}
-	return ejb;
-}
-
 void init_pthread_helper()
 {
 	real_pthread_cleanup_push_defer = (vFppp_t)dlsym(NULL, "_pthread_cleanup_push_defer");
@@ -1108,8 +1086,6 @@ void init_pthread_helper()
 	}
 
 	InitCancelThread();
-	pthread_key_create(&jmpbuf_key, emujmpbuf_destroy);
-	pthread_setspecific(jmpbuf_key, NULL);
 	pthread_key_create(&thread_key, emuthread_destroy);
 	pthread_setspecific(thread_key, NULL);
 }
@@ -1118,11 +1094,6 @@ void fini_pthread_helper(box64context_t* context)
 {
 	FreeCancelThread(context);
 	CleanStackSize(context);
-	emu_jmpbuf_t *ejb = (emu_jmpbuf_t*)pthread_getspecific(jmpbuf_key);
-	if(ejb) {
-		pthread_setspecific(jmpbuf_key, NULL);
-		emujmpbuf_destroy(ejb);
-	}
 	emuthread_t *et = (emuthread_t*)pthread_getspecific(thread_key);
 	if(et) {
 		pthread_setspecific(thread_key, NULL);