diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-12-01 08:24:17 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-03-14 11:57:20 +0300 |
commit | 4477acf4d62aeb4fa55d11f67a00d697afc1941e (patch) | |
tree | 9b800ca0540fc994fcbc48bf555d6ca2ee74c0e4 | |
parent | 4fe277030982be0a107cdbb76584769809aef4ca (diff) | |
download | bdwgc-4477acf4d62aeb4fa55d11f67a00d697afc1941e.tar.gz |
Fix unregistering of thread created by intercepted pthread_create on NaCl
(a cherry-pick of commit ee779ffc5 from 'master')
* pthread_start.c [GC_PTHREADS && !GC_WIN32_THREADS && NACL]
(GC_pthread_start_inner): Call GC_thread_exit_proc(me) before return.
-rw-r--r-- | pthread_start.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pthread_start.c b/pthread_start.c index d99026b0..c1f6a5fe 100644 --- a/pthread_start.c +++ b/pthread_start.c @@ -60,10 +60,12 @@ GC_INNER_PTHRSTART void * GC_CALLBACK GC_inner_start_routine( # endif me -> status = result; GC_end_stubborn_change(me); /* cannot use GC_dirty */ -# ifndef NACL + /* Cleanup acquires lock, ensuring that we can't exit while */ + /* a collection that thinks we're alive is trying to stop us. */ +# ifdef NACL + GC_thread_exit_proc((void *)me); +# else pthread_cleanup_pop(1); - /* Cleanup acquires lock, ensuring that we can't exit while */ - /* a collection that thinks we're alive is trying to stop us. */ # endif return result; } |