From owner-svn-src-stable@freebsd.org Wed Feb 14 00:32:20 2018 Return-Path: Delivered-To: svn-src-stable@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 BAFBCF10059; Wed, 14 Feb 2018 00:32:20 +0000 (UTC) (envelope-from markj@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 4C0E97AF87; Wed, 14 Feb 2018 00:32:20 +0000 (UTC) (envelope-from markj@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 46F51417; Wed, 14 Feb 2018 00:32:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1E0WK0S009440; Wed, 14 Feb 2018 00:32:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1E0WKKl009439; Wed, 14 Feb 2018 00:32:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802140032.w1E0WKKl009439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 14 Feb 2018 00:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r329255 - stable/11/usr.bin/sort X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/usr.bin/sort X-SVN-Commit-Revision: 329255 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 00:32:20 -0000 Author: markj Date: Wed Feb 14 00:32:19 2018 New Revision: 329255 URL: https://svnweb.freebsd.org/changeset/base/329255 Log: MFC r328995: Fix the WITH_SORT_THREADS build. PR: 201664 Modified: stable/11/usr.bin/sort/radixsort.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/sort/radixsort.c ============================================================================== --- stable/11/usr.bin/sort/radixsort.c Wed Feb 14 00:31:45 2018 (r329254) +++ stable/11/usr.bin/sort/radixsort.c Wed Feb 14 00:32:19 2018 (r329255) @@ -127,6 +127,14 @@ have_sort_left(void) #endif /* SORT_THREADS */ +static void +_push_ls(struct level_stack *ls) +{ + + ls->next = g_ls; + g_ls = ls; +} + /* * Push sort level to the stack */ @@ -139,22 +147,14 @@ push_ls(struct sort_level *sl) new_ls->sl = sl; #if defined(SORT_THREADS) - if (nthreads > 1) + if (nthreads > 1) { pthread_mutex_lock(&g_ls_mutex); -#endif - - new_ls->next = g_ls; - g_ls = new_ls; - -#if defined(SORT_THREADS) - if (nthreads > 1) + _push_ls(new_ls); pthread_cond_signal(&g_ls_cond); -#endif - -#if defined(SORT_THREADS) - if (nthreads > 1) pthread_mutex_unlock(&g_ls_mutex); + } else #endif + _push_ls(new_ls); } /*