mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Make allocator in pool_add_task() explicit
This commit is contained in:
@@ -113,9 +113,8 @@ pool_join :: proc(pool: ^Pool) {
|
|||||||
// the thread pool. You can even add tasks from inside other tasks.
|
// 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
|
// 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
|
// safe.
|
||||||
// nil_allocator.
|
pool_add_task :: proc(pool: ^Pool, procedure: Task_Proc, data: rawptr, user_index: int = 0, allocator: mem.Allocator) {
|
||||||
pool_add_task :: proc(pool: ^Pool, procedure: Task_Proc, data: rawptr, user_index: int = 0, allocator := context.allocator) {
|
|
||||||
sync.guard(&pool.mutex)
|
sync.guard(&pool.mutex)
|
||||||
|
|
||||||
append(&pool.tasks, Task{
|
append(&pool.tasks, Task{
|
||||||
|
|||||||
Reference in New Issue
Block a user