svn commit: r341278 - head/lib/libthr/thread

Eric van Gyzen vangyzen at FreeBSD.org
Fri Nov 30 03:03:22 UTC 2018


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.");


More information about the svn-src-head mailing list