Date: Fri, 30 Nov 2018 03:02:49 +0000 (UTC) From: Eric van Gyzen <vangyzen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341278 - head/lib/libthr/thread Message-ID: <201811300302.wAU32n7s059985@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vangyzen Date: Fri Nov 30 03:02:49 2018 New Revision: 341278 URL: https://svnweb.freebsd.org/changeset/base/341278 Log: Use _thr_isthreaded() and _thr_setthreaded() wrappers ...instead of directly using the global variable. MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_spinlock.c Modified: head/lib/libthr/thread/thr_fork.c ============================================================================== --- head/lib/libthr/thread/thr_fork.c Fri Nov 30 03:01:32 2018 (r341277) +++ head/lib/libthr/thread/thr_fork.c Fri Nov 30 03:02:49 2018 (r341278) @@ -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. */ Modified: head/lib/libthr/thread/thr_spinlock.c ============================================================================== --- head/lib/libthr/thread/thr_spinlock.c Fri Nov 30 03:01:32 2018 (r341277) +++ head/lib/libthr/thread/thr_spinlock.c Fri Nov 30 03:02:49 2018 (r341278) @@ -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.");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811300302.wAU32n7s059985>