From: Brendan Hansen Date: Tue, 23 Nov 2021 05:02:19 +0000 (-0600) Subject: made thread.spawn polymorphic to make quick functions nicer X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=77f27e371c882b20994e9b6c983784a95620f519;p=onyx.git made thread.spawn polymorphic to make quick functions nicer --- diff --git a/core/threads/thread.onyx b/core/threads/thread.onyx index 8c69bb30..a2c6a267 100644 --- a/core/threads/thread.onyx +++ b/core/threads/thread.onyx @@ -18,7 +18,7 @@ Thread :: struct { alive : bool; } -spawn :: (t: ^Thread, data: rawptr, func: (rawptr) -> void) { +spawn :: (t: ^Thread, data: ^$T, func: (^T) -> void) { sync.scoped_mutex(^thread_mutex); t.id = next_thread_id;