From owner-svn-src-head@freebsd.org Fri Nov 30 03:03:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A0D1155B60; Fri, 30 Nov 2018 03:03:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34C0D8F840; Fri, 30 Nov 2018 03:02:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1339E22A82; Fri, 30 Nov 2018 03:02:50 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAU32nmS059987; Fri, 30 Nov 2018 03:02:49 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAU32n7s059985; Fri, 30 Nov 2018 03:02:49 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201811300302.wAU32n7s059985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 30 Nov 2018 03:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341278 - head/lib/libthr/thread X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libthr/thread X-SVN-Commit-Revision: 341278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 34C0D8F840 X-Spamd-Result: default: False [1.11 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.31)[0.307,0]; NEURAL_SPAM_MEDIUM(0.26)[0.256,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.55)[0.546,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Nov 2018 03:03:22 -0000 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.");