mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
reorder procedure parameters to make sure the optional argument in pool_add_task() is last, and the argument order is consistent with pool_init()
This commit is contained in:
@@ -47,7 +47,7 @@ Pool :: struct {
|
|||||||
// it is destroyed.
|
// it is destroyed.
|
||||||
//
|
//
|
||||||
// The thread pool requires an allocator which it either owns, or which is thread safe.
|
// The thread pool requires an allocator which it either owns, or which is thread safe.
|
||||||
pool_init :: proc(pool: ^Pool, thread_count: int, allocator: mem.Allocator) {
|
pool_init :: proc(pool: ^Pool, allocator: mem.Allocator, thread_count: int) {
|
||||||
context.allocator = allocator
|
context.allocator = allocator
|
||||||
pool.allocator = allocator
|
pool.allocator = allocator
|
||||||
pool.tasks = make([dynamic]Task)
|
pool.tasks = make([dynamic]Task)
|
||||||
@@ -114,7 +114,7 @@ pool_join :: proc(pool: ^Pool) {
|
|||||||
//
|
//
|
||||||
// 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.
|
// safe.
|
||||||
pool_add_task :: proc(pool: ^Pool, procedure: Task_Proc, data: rawptr, user_index: int = 0, allocator: mem.Allocator) {
|
pool_add_task :: proc(pool: ^Pool, allocator: mem.Allocator, procedure: Task_Proc, data: rawptr, user_index: int = 0) {
|
||||||
sync.guard(&pool.mutex)
|
sync.guard(&pool.mutex)
|
||||||
|
|
||||||
append(&pool.tasks, Task{
|
append(&pool.tasks, Task{
|
||||||
|
|||||||
Reference in New Issue
Block a user