Use _thr_isthreaded() and _thr_setthreaded() wrappers

...instead of directly using the global variable.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
This commit is contained in:
vangyzen 2018-11-30 03:02:49 +00:00
parent abc905bddf
commit 94e9e060ae
2 changed files with 4 additions and 4 deletions

View File

@ -219,9 +219,9 @@ __thr_fork(void)
_thr_rwl_rdlock(&_thr_atfork_lock);
if (was_threaded) {
__isthreaded = 1;
_thr_setthreaded(1);
_malloc_postfork();
__isthreaded = 0;
_thr_setthreaded(0);
}
/* Ready to continue, unblock signals. */

View File

@ -58,7 +58,7 @@ static int initialized;
static void init_spinlock(spinlock_t *lck);
/*
* These are for compatability only. Spinlocks of this type
* These are for compatibility only. Spinlocks of this type
* are deprecated.
*/
@ -76,7 +76,7 @@ __thr_spinlock(spinlock_t *lck)
{
struct spinlock_extra *_extra;
if (!__isthreaded)
if (!_thr_isthreaded())
PANIC("Spinlock called when not threaded.");
if (!initialized)
PANIC("Spinlocks not initialized.");