]> granicus.if.org Git - gc/commit
New macro (GC_ALWAYS_MULTITHREADED) to set multi-threaded mode implicitly
authorIvan Maidanski <ivmai@mail.ru>
Sun, 1 Dec 2013 15:01:46 +0000 (19:01 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 1 Dec 2013 15:02:35 +0000 (19:02 +0400)
commitd5c65315be6b19becc29afe0f020ad9618e9fdff
treefcee8a006a4d987cb2ef1c9e68ef370d5d5003e0
parente741b4525ca2d1b89de57205b5e7e8058988703a
New macro (GC_ALWAYS_MULTITHREADED) to set multi-threaded mode implicitly

* darwin_stop_world.c (GC_use_threads_discovery): Skip assertion on
GC_need_to_lock if GC_ALWAYS_MULTITHREADED.
* misc.c (GC_init): Likewise.
* doc/README.macros (GC_ALWAYS_MULTITHREADED): Document.
* include/gc.h (GC_allow_register_threads): Update comment (regarding
GC_ALWAYS_MULTITHREADED).
* include/private/gc_locks.h (I_HOLD_LOCK): Reformat code.
* include/private/gc_locks.h (GC_need_to_lock): Define as macro
(to TRUE) if GC_ALWAYS_MULTITHREADED defined.
* include/private/gc_locks.h (LOCK, UNLOCK): Define to UNCOND_[UN]LOCK
if GC_ALWAYS_MULTITHREADED.
* misc.c (GC_init): Call GC_init_parallel() if GC_ALWAYS_MULTITHREADED
but not GC_NO_THREADS_DISCOVERY (only for Win32, needed since
GC_allow_register_threads does nothing if GC_ALWAYS_MULTITHREADED).
* misc.c (IF_NEED_TO_LOCK): Ignore GC_parallel if
GC_ALWAYS_MULTITHREADED (since GC_need_to_lock is always true).
* pthread_support.c (GC_need_to_lock): Do not define varaible if
GC_ALWAYS_MULTITHREADED (since defined as a macro).
* win32_threads.c (GC_need_to_lock): Likewise.
* pthread_support.c (GC_allow_register_threads, pthread_create): Do
not alter value of GC_need_to_lock if GC_ALWAYS_MULTITHREADED.
* win32_threads.c (GC_allow_register_threads, GC_CreateThread,
GC_beginthreadex, GC_pthread_create, GC_init_parallel): Likewise.
* win32_threads.c (GC_allow_register_threads): Do not alter
"parallel_initialized" value if GC_ALWAYS_MULTITHREADED (so that
GC_allow_register_threads is a no-op if the macro defined).
darwin_stop_world.c
doc/README.macros
include/gc.h
include/private/gc_locks.h
misc.c
pthread_support.c
win32_threads.c