]> granicus.if.org Git - gc/commit
Code refactoring of thread suspend/resume API support
authorIvan Maidanski <ivmai@mail.ru>
Thu, 29 Oct 2015 17:33:48 +0000 (20:33 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 19 Nov 2015 22:37:52 +0000 (01:37 +0300)
commit9f48082eafc4d54ca33390a72924715b03d7c1dd
tree9d508a0056c8ebab09d02f283eaf1ba3d311adab
parentd34d5b53d67b3ef6fa2d70a945e21f023cb9e3e7
Code refactoring of thread suspend/resume API support

* CMakeLists.txt (enable_gcj_support): Define GC_ENABLE_SUSPEND_THREAD.
* configure.ac (enable_gcj_support): Likewise.
* doc/README.macros (GC_ENABLE_SUSPEND_THREAD): Document.
* include/gc.h (GC_suspend_thread, GC_resume_thread,
GC_is_thread_suspended): Move to javaxfc.h.
* include/gc_pthread_redirects.h (GC_SUSPEND_THREAD_ID): New macro.
* include/javaxfc.h (GC_SUSPEND_THREAD_ID): Likewise.
* include/javaxfc.h (GC_suspend_thread, GC_resume_thread,
GC_is_thread_suspended): Define if and only if GC_THREADS; refine
comment.
* include/javaxfc.h (GC_suspend_thread, GC_resume_thread,
GC_is_thread_suspended): Decorate with GC_CALL; change argument type
from pthread_t to GC_SUSPEND_THREAD_ID.
* pthread_stop_world.c (GC_suspend_thread, GC_resume_thread,
GC_is_thread_suspended): Likewise.
* pthread_stop_world.c (GC_suspend_handler): Move check for
SUSPENDED_EXT to GC_suspend_handler_inner (to avoid duplicate
GC_lookup_thread call).
* pthread_stop_world.c (suspend_self_inner, GC_TIME_LIMIT,
GC_brief_async_signal_safe_sleep, GC_suspend_thread, GC_resume_thread,
GC_is_thread_suspended): Do not defined unless
GC_ENABLE_SUSPEND_THREAD.
* pthread_stop_world.c (suspend_self): Remove (invoke
GC_do_blocking(suspend_self_inner) directly).
* pthread_stop_world.c (GC_brief_async_signal_safe_sleep): Decorate
with STATIC.
* pthread_stop_world.c (GC_suspend_thread, GC_resume_thread,
GC_is_thread_suspended): Wrap code into LOCK/UNLOCK (because, at least,
GC_lookup_thread should be called with the allocation lock held).
* pthread_stop_world.c (GC_suspend_thread, GC_resume_thread): Do not
ABORT if thread is unregistered in GC (just no-op instead).
* pthread_stop_world.c (GC_is_thread_suspended): Return 0 if thread is
not registered in GC.
CMakeLists.txt
configure.ac
doc/README.macros
include/gc.h
include/gc_pthread_redirects.h
include/javaxfc.h
pthread_stop_world.c