diff options
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r-- | newlib/libc/stdlib/__atexit.c | 8 | ||||
-rw-r--r-- | newlib/libc/stdlib/__call_atexit.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/newlib/libc/stdlib/__atexit.c b/newlib/libc/stdlib/__atexit.c index b68d80f9c..a26d2eccc 100644 --- a/newlib/libc/stdlib/__atexit.c +++ b/newlib/libc/stdlib/__atexit.c @@ -10,7 +10,7 @@ /* Make this a weak reference to avoid pulling in malloc. */ void * malloc(size_t) _ATTRIBUTE((__weak__)); -__LOCK_INIT(, __atexit_lock); +__LOCK_INIT_RECURSIVE(, __atexit_lock); /* * Register a function to be performed at exit or on shared library unload. @@ -28,7 +28,7 @@ _DEFUN (__register_exitproc, register struct _atexit *p; #ifndef __SINGLE_THREAD__ - __lock_acquire(__atexit_lock); + __lock_acquire_recursive(__atexit_lock); #endif p = _GLOBAL_REENT->_atexit; @@ -48,7 +48,7 @@ _DEFUN (__register_exitproc, if (p == NULL) { #ifndef __SINGLE_THREAD__ - __lock_release(__atexit_lock); + __lock_release_recursive(__atexit_lock); #endif return -1; } @@ -93,7 +93,7 @@ _DEFUN (__register_exitproc, } p->_fns[p->_ind++] = fn; #ifndef __SINGLE_THREAD__ - __lock_release(__atexit_lock); + __lock_release_recursive(__atexit_lock); #endif return 0; } diff --git a/newlib/libc/stdlib/__call_atexit.c b/newlib/libc/stdlib/__call_atexit.c index 5365f32e9..813c34da6 100644 --- a/newlib/libc/stdlib/__call_atexit.c +++ b/newlib/libc/stdlib/__call_atexit.c @@ -33,7 +33,7 @@ _DEFUN (__call_exitprocs, (code, d), #ifndef __SINGLE_THREAD__ - __lock_acquire(__atexit_lock); + __lock_acquire_recursive(__atexit_lock); #endif restart: @@ -115,7 +115,7 @@ _DEFUN (__call_exitprocs, (code, d), #endif } #ifndef __SINGLE_THREAD__ - __lock_release(__atexit_lock); + __lock_release_recursive(__atexit_lock); #endif } |