summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2016-06-20 11:38:50 +0300
committerIvan Maidanski <ivmai@mail.ru>2016-06-20 11:38:50 +0300
commit59e2bcf96430d5ae4e307ac5d8323bf4ea679e47 (patch)
tree524bbbc87fcdc527917fc4df9e596ca7a7fcd0ef /mallocx.c
parent5327b21e518fd62254e33b135eb5e1d217f9fa77 (diff)
downloadbdwgc-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