From owner-svn-src-head@freebsd.org Wed Feb 7 20:36:38 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 683D9ED6CF1; Wed, 7 Feb 2018 20:36:38 +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 17F467DE30; Wed, 7 Feb 2018 20:36:38 +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 0E464412D; Wed, 7 Feb 2018 20:36:38 +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 w17KabUS012261; Wed, 7 Feb 2018 20:36:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17KabqK012260; Wed, 7 Feb 2018 20:36:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802072036.w17KabqK012260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Feb 2018 20:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328995 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 328995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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: Wed, 07 Feb 2018 20:36:38 -0000 Author: markj Date: Wed Feb 7 20:36:37 2018 New Revision: 328995 URL: https://svnweb.freebsd.org/changeset/base/328995 Log: Fix the WITH_SORT_THREADS build. PR: 201664 MFC after: 1 week Modified: head/usr.bin/sort/radixsort.c Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Wed Feb 7 20:13:08 2018 (r328994) +++ head/usr.bin/sort/radixsort.c Wed Feb 7 20:36:37 2018 (r328995) @@ -129,6 +129,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 */ @@ -141,22 +149,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); } /*