about summary refs log tree commit diff stats
path: root/src/libtools/threads.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-09-10 16:55:25 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-09-10 16:55:25 +0200
commit2127eaea221e89a44ececc87bc74f7d7b44873d0 (patch)
tree31b933173829048a29d4fb08ff4fddd606831a0b /src/libtools/threads.c
parent7794a623aa27351b12a50fe9bf9f92ddac10d512 (diff)
downloadbox64-2127eaea221e89a44ececc87bc74f7d7b44873d0.tar.gz
box64-2127eaea221e89a44ececc87bc74f7d7b44873d0.zip
[BOX32] Put back pthread_t behind hash, but ease hash range to have more native values
Diffstat (limited to 'src/libtools/threads.c')
-rw-r--r--src/libtools/threads.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libtools/threads.c b/src/libtools/threads.c
index f51f95c6..15a14422 100644
--- a/src/libtools/threads.c
+++ b/src/libtools/threads.c
@@ -134,6 +134,10 @@ static void emuthread_destroy(void* p)
 	emuthread_t *et = (emuthread_t*)p;
 	if(!et)
 		return;
+	#ifdef BOX32
+	if(!et->join && et->fnc)
+		to_hash_d(et->self);
+	#endif
 	FreeX64Emu(&et->emu);
 	box_free(et);
 }
@@ -177,6 +181,7 @@ void thread_set_emu(x64emu_t* emu)
 	#ifdef BOX32
 	if(box64_is32bits) {
 		et->self = (uintptr_t)pthread_self();
+		et->hself = to_hash(et->self);
 	}
 	#endif
 	pthread_setspecific(thread_key, et);