diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-06-20 11:38:50 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-06-20 11:38:50 +0300 |
commit | 59e2bcf96430d5ae4e307ac5d8323bf4ea679e47 (patch) | |
tree | 524bbbc87fcdc527917fc4df9e596ca7a7fcd0ef /mallocx.c | |
parent | 5327b21e518fd62254e33b135eb5e1d217f9fa77 (diff) | |
download | bdwgc-59e2bcf96430d5ae4e307ac5d8323bf4ea679e47.tar.gz |
Fix deadlock (and double lock) in explicit thread suspend/resume
* pthread_stop_world.c (GC_suspend_handler_inner)
[GC_ENABLE_SUSPEND_THREAD]: If SUSPENDED_EXT flag then set
stop_info.stack_ptr, call sem_post(suspend_ack_sem), and call
suspend_self_inner instead of GC_do_blocking(suspend_self_inner).
* pthread_stop_world.c [GC_ENABLE_SUSPEND_THREAD] (GC_suspend_thread):
No-op if already suspended; UNLOCK before GC_do_blocking (if
self-suspend); add TODO about GC_retry_signals; clear SUSPENDED_EXT
flag if RAISE_SIGNAL failed with ESRCH code; sem_wait(suspend_ack_sem)
to let the suspend handler to lookup the thread and store stack_ptr
(and save registers if needed).
* pthread_stop_world.c (GC_suspend_all, GC_start_world): Skip threads
with SUSPENDED_EXT flag.
Diffstat (limited to 'mallocx.c')
0 files changed, 0 insertions, 0 deletions