diff options
| author | gingerBill <bill@gingerbill.org> | 2023-01-01 14:48:31 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-01-01 14:48:31 +0000 |
| commit | 60d0390ef8ceabb0567ee1ba968fdaf2024d34bf (patch) | |
| tree | ba302980b05805d96c32e6d18f263adc56e63106 /src/thread_pool.cpp | |
| parent | c08ff891ad05605be56ea6a789e8d6c9a801da1f (diff) | |
Unify compiler `Futex` interface
Diffstat (limited to 'src/thread_pool.cpp')
| -rw-r--r-- | src/thread_pool.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index 3565ef25a..57ed5e3c5 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -136,7 +136,7 @@ gb_internal void thread_pool_wait(ThreadPool *pool) { break; } - tpool_wait_on_addr(&pool->tasks_left, rem_tasks); + futex_wait(&pool->tasks_left, rem_tasks); } } @@ -160,7 +160,7 @@ work_start: finished_tasks += 1; } if (finished_tasks > 0 && !pool->tasks_left) { - tpool_wake_addr(&pool->tasks_left); + futex_signal(&pool->tasks_left); } // If there's still work somewhere and we don't have it, steal it @@ -183,7 +183,7 @@ work_start: pool->tasks_left.fetch_sub(1); if (!pool->tasks_left) { - tpool_wake_addr(&pool->tasks_left); + futex_signal(&pool->tasks_left); } goto work_start; |