summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorivmai <ivmai>2010-03-05 15:26:16 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:53 +0200
commitc7047ca9e961af21c6a520a0765d1226ab510377 (patch)
tree059fad9889091d68a5e75ff3f7dc11759d80f3d2 /misc.c
parentb53f714c2d40de8edbfb635e554f027276d66d20 (diff)
2010-03-05 Ivan Maidanski <ivmai@mail.ru>
* alloc.c (GC_set_stop_func, GC_get_stop_func): Add DCL_LOCK_STATE. * finalize.c (GC_notify_or_invoke_finalizers): Ditto. * gc_dlopen.c (disable_gc_for_dlopen): Ditto. * gcj_mlc.c (maybe_finalize, GC_debug_gcj_malloc): Ditto. * mark.c (GC_print_trace): Ditto. * misc.c (GC_set_warn_proc, GC_get_warn_proc, GC_enable, GC_disable, GC_new_free_list, GC_new_kind, GC_new_proc, GC_set_oom_fn, GC_get_oom_fn, GC_set_finalizer_notifier, GC_get_finalizer_notifier): Ditto. * os_dep.c (GC_get_stack_base, GC_print_callers): Ditto. * pthread_support.c (GC_is_thread_tsd_valid, GC_wait_for_gc_completion, GC_init_parallel, GC_do_blocking_inner, GC_call_with_gc_active, GC_unregister_my_thread, pthread_join, pthread_detach, GC_register_my_thread, GC_inner_start_routine, pthread_create): Ditto. * reclaim.c (GC_print_all_errors): Ditto. * win32_threads.c (GC_is_thread_tsd_valid, GC_register_my_thread, GC_unregister_my_thread, GC_do_blocking_inner, GC_call_with_gc_active, GC_lookup_pthread, GC_pthread_join, GC_pthread_start_inner, GC_thread_exit_proc, GC_pthread_detach, GC_init_parallel): Ditto.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/misc.c b/misc.c
index 7fa5899..f3efd3f 100644
--- a/misc.c
+++ b/misc.c
@@ -1305,6 +1305,7 @@ GC_API void GC_CALLBACK GC_ignore_warn_proc(char *msg, GC_word arg)
GC_API void GC_CALL GC_set_warn_proc(GC_warn_proc p)
{
+ DCL_LOCK_STATE;
GC_ASSERT(p != 0);
# ifdef GC_WIN32_THREADS
# ifdef CYGWIN32
@@ -1322,6 +1323,7 @@ GC_API void GC_CALL GC_set_warn_proc(GC_warn_proc p)
GC_API GC_warn_proc GC_CALL GC_get_warn_proc(void)
{
GC_warn_proc result;
+ DCL_LOCK_STATE;
LOCK();
result = GC_current_warn_proc;
UNLOCK();
@@ -1381,6 +1383,7 @@ GC_API GC_warn_proc GC_CALL GC_get_warn_proc(void)
GC_API void GC_CALL GC_enable(void)
{
+ DCL_LOCK_STATE;
LOCK();
GC_dont_gc--;
UNLOCK();
@@ -1388,6 +1391,7 @@ GC_API void GC_CALL GC_enable(void)
GC_API void GC_CALL GC_disable(void)
{
+ DCL_LOCK_STATE;
LOCK();
GC_dont_gc++;
UNLOCK();
@@ -1406,6 +1410,7 @@ GC_API void ** GC_CALL GC_new_free_list_inner(void)
GC_API void ** GC_CALL GC_new_free_list(void)
{
void *result;
+ DCL_LOCK_STATE;
LOCK();
result = GC_new_free_list_inner();
UNLOCK();
@@ -1430,6 +1435,7 @@ GC_API unsigned GC_CALL GC_new_kind(void **fl, GC_word descr, int adjust,
int clear)
{
unsigned result;
+ DCL_LOCK_STATE;
LOCK();
result = GC_new_kind_inner(fl, descr, adjust, clear);
UNLOCK();
@@ -1448,6 +1454,7 @@ GC_API unsigned GC_CALL GC_new_proc_inner(GC_mark_proc proc)
GC_API unsigned GC_CALL GC_new_proc(GC_mark_proc proc)
{
unsigned result;
+ DCL_LOCK_STATE;
LOCK();
result = GC_new_proc_inner(proc);
UNLOCK();
@@ -1611,6 +1618,7 @@ GC_API int GC_CALL GC_get_parallel(void)
GC_API void GC_CALL GC_set_oom_fn(GC_oom_func fn)
{
GC_ASSERT(fn != 0);
+ DCL_LOCK_STATE;
LOCK();
GC_oom_fn = fn;
UNLOCK();
@@ -1619,6 +1627,7 @@ GC_API void GC_CALL GC_set_oom_fn(GC_oom_func fn)
GC_API GC_oom_func GC_CALL GC_get_oom_fn(void)
{
GC_oom_func fn;
+ DCL_LOCK_STATE;
LOCK();
fn = GC_oom_fn;
UNLOCK();
@@ -1628,6 +1637,7 @@ GC_API GC_oom_func GC_CALL GC_get_oom_fn(void)
GC_API void GC_CALL GC_set_finalizer_notifier(GC_finalizer_notifier_proc fn)
{
/* fn may be 0 (means no finalizer notifier). */
+ DCL_LOCK_STATE;
LOCK();
GC_finalizer_notifier = fn;
UNLOCK();
@@ -1636,6 +1646,7 @@ GC_API void GC_CALL GC_set_finalizer_notifier(GC_finalizer_notifier_proc fn)
GC_API GC_finalizer_notifier_proc GC_CALL GC_get_finalizer_notifier(void)
{
GC_finalizer_notifier_proc fn;
+ DCL_LOCK_STATE;
LOCK();
fn = GC_finalizer_notifier;
UNLOCK();