made thread.spawn polymorphic to make quick functions nicer
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 23 Nov 2021 05:02:19 +0000 (23:02 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 23 Nov 2021 05:02:19 +0000 (23:02 -0600)
core/threads/thread.onyx

index 8c69bb3025c648c657f4329e5719bca830015355..a2c6a267fa350352cb0eb281ced2a0c4f1c433c6 100644 (file)
@@ -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;