aboutsummaryrefslogtreecommitdiff
path: root/core/thread
diff options
context:
space:
mode:
authorflysand7 <yyakut.ac@gmail.com>2023-11-11 20:36:38 +1100
committerflysand7 <yyakut.ac@gmail.com>2023-11-11 20:36:38 +1100
commit270348b112d0becce7726023b72784066d02306d (patch)
tree8fc136e37ac82164e06c4072433b5df37edeae64 /core/thread
parent59675949da61078c67faaaf127c54e89ff37fb52 (diff)
[core]: Remove `do` keyword from the core library
Diffstat (limited to 'core/thread')
-rw-r--r--core/thread/thread.odin24
1 files changed, 18 insertions, 6 deletions
diff --git a/core/thread/thread.odin b/core/thread/thread.odin
index fd8e59a5d..9ba03203f 100644
--- a/core/thread/thread.odin
+++ b/core/thread/thread.odin
@@ -147,7 +147,9 @@ create_and_start :: proc(fn: proc(), init_context: Maybe(runtime.Context) = nil,
}
t := create(thread_proc, priority)
t.data = rawptr(fn)
- if self_cleanup do t.flags += {.Self_Cleanup}
+ if self_cleanup {
+ t.flags += {.Self_Cleanup}
+ }
t.init_context = init_context
start(t)
return t
@@ -167,7 +169,9 @@ create_and_start_with_data :: proc(data: rawptr, fn: proc(data: rawptr), init_co
t.data = rawptr(fn)
t.user_index = 1
t.user_args = data
- if self_cleanup do t.flags += {.Self_Cleanup}
+ if self_cleanup {
+ t.flags += {.Self_Cleanup}
+ }
t.init_context = init_context
start(t)
return t
@@ -186,7 +190,9 @@ create_and_start_with_poly_data :: proc(data: $T, fn: proc(data: T), init_contex
t.user_index = 1
data := data
mem.copy(&t.user_args[0], &data, size_of(data))
- if self_cleanup do t.flags += {.Self_Cleanup}
+ if self_cleanup {
+ t.flags += {.Self_Cleanup}
+ }
t.init_context = init_context
start(t)
return t
@@ -208,7 +214,9 @@ create_and_start_with_poly_data2 :: proc(arg1: $T1, arg2: $T2, fn: proc(T1, T2),
arg1, arg2 := arg1, arg2
mem.copy(&t.user_args[0], &arg1, size_of(arg1))
mem.copy(&t.user_args[1], &arg2, size_of(arg2))
- if self_cleanup do t.flags += {.Self_Cleanup}
+ if self_cleanup {
+ t.flags += {.Self_Cleanup}
+ }
t.init_context = init_context
start(t)
return t
@@ -233,7 +241,9 @@ create_and_start_with_poly_data3 :: proc(arg1: $T1, arg2: $T2, arg3: $T3, fn: pr
mem.copy(&t.user_args[0], &arg1, size_of(arg1))
mem.copy(&t.user_args[1], &arg2, size_of(arg2))
mem.copy(&t.user_args[2], &arg3, size_of(arg3))
- if self_cleanup do t.flags += {.Self_Cleanup}
+ if self_cleanup {
+ t.flags += {.Self_Cleanup}
+ }
t.init_context = init_context
start(t)
return t
@@ -259,7 +269,9 @@ create_and_start_with_poly_data4 :: proc(arg1: $T1, arg2: $T2, arg3: $T3, arg4:
mem.copy(&t.user_args[1], &arg2, size_of(arg2))
mem.copy(&t.user_args[2], &arg3, size_of(arg3))
mem.copy(&t.user_args[3], &arg4, size_of(arg4))
- if self_cleanup do t.flags += {.Self_Cleanup}
+ if self_cleanup {
+ t.flags += {.Self_Cleanup}
+ }
t.init_context = init_context
start(t)
return t