diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2018-02-07 20:36:37 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2018-02-07 20:36:37 +0000 |
| commit | 7f180c0f807bf43676723cee340a7a5f72cb683a (patch) | |
| tree | 5a040283b32154042626862eeffde97df59ef9bf /usr.bin/sort | |
| parent | 919da4ceff155efd6bd59c368d538029312cc2ca (diff) | |
Notes
Diffstat (limited to 'usr.bin/sort')
| -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 9affcd29d8d1..8c43c61faf8c 100644 --- a/usr.bin/sort/radixsort.c +++ b/usr.bin/sort/radixsort.c @@ -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); } /* |
