diff options
author | markj <markj@FreeBSD.org> | 2018-02-14 00:32:19 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2018-02-14 00:32:19 +0000 |
commit | 7e082e9b08df963ac4928401bbef9662d862b2f2 (patch) | |
tree | 50738af8282398c7c8e8a276dfcb174a67123b0f /usr.bin | |
parent | 12c6fecde5c6210a7262bd2d33f364849994eb35 (diff) | |
download | FreeBSD-src-7e082e9b08df963ac4928401bbef9662d862b2f2.zip FreeBSD-src-7e082e9b08df963ac4928401bbef9662d862b2f2.tar.gz |
MFC r328995:
Fix the WITH_SORT_THREADS build.
PR: 201664
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sort/radixsort.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/sort/radixsort.c b/usr.bin/sort/radixsort.c index 62b9460..b3a31a0 100644 --- a/usr.bin/sort/radixsort.c +++ b/usr.bin/sort/radixsort.c @@ -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); } /* |