Make allocator in pool_add_task() explicit

This commit is contained in:
Florian Behr
2022-04-25 13:23:05 +02:00
committed by GitHub
parent 63331ef731
commit e01662c139
+2 -3
View File
@@ -113,9 +113,8 @@ pool_join :: proc(pool: ^Pool) {
// the thread pool. You can even add tasks from inside other tasks.
//
// Each task also needs an allocator which it either owns, or which is thread
// safe. By default, allocations in the task are disabled by use of the
// nil_allocator.
pool_add_task :: proc(pool: ^Pool, procedure: Task_Proc, data: rawptr, user_index: int = 0, allocator := context.allocator) {
// safe.
pool_add_task :: proc(pool: ^Pool, procedure: Task_Proc, data: rawptr, user_index: int = 0, allocator: mem.Allocator) {
sync.guard(&pool.mutex)
append(&pool.tasks, Task{