aboutsummaryrefslogtreecommitdiff
path: root/core/thread/thread_pool.odin
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-06-29 15:58:24 +0100
committergingerBill <bill@gingerbill.org>2020-06-29 15:58:24 +0100
commit86448ee044aa29ed4a7b5ab3365fb40ce9147422 (patch)
tree3942deedcb1e5da44cbd3f704fcb7432b25103e1 /core/thread/thread_pool.odin
parent56a52a1d06346edaee316e6d53c4cbd6a07e1056 (diff)
Add `raw_data` to replace cases in which `&x[0]` was used
Diffstat (limited to 'core/thread/thread_pool.odin')
-rw-r--r--core/thread/thread_pool.odin3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/thread/thread_pool.odin b/core/thread/thread_pool.odin
index 8b6b15ece..64cd8ea38 100644
--- a/core/thread/thread_pool.odin
+++ b/core/thread/thread_pool.odin
@@ -116,9 +116,8 @@ pool_try_and_pop_task :: proc(pool: ^Pool) -> (task: Task, got_task: bool = fals
if sync.mutex_try_lock(&pool.mutex) {
if len(pool.tasks) != 0 {
intrinsics.atomic_add(&pool.processing_task_count, 1);
- task = pool.tasks[0];
+ task = pop_front(&pool.tasks);
got_task = true;
- ordered_remove(&pool.tasks, 0);
}
sync.mutex_unlock(&pool.mutex);
}