summaryrefslogtreecommitdiff
path: root/std/thread.zc
diff options
context:
space:
mode:
authorsuresh <sureshkrishnan.ai@gmail.com>2026-01-25 11:43:23 -0500
committersuresh <sureshkrishnan.ai@gmail.com>2026-01-25 11:43:23 -0500
commit26a0b55ed5bce4ad0ba2af109cfc96da7be2e34c (patch)
tree35ba8d7742b8ac727bfc6c4c73ab8b70f6eedb53 /std/thread.zc
parent0bb69cb67078dfa921b5b8a42275ef31dfbc9a56 (diff)
parent489336b2101bf16edeec7bfc4379408eb19b936e (diff)
Merge branch 'main' into JsonType
# Conflicts: # examples/data/json_config.zc
Diffstat (limited to 'std/thread.zc')
-rw-r--r--std/thread.zc10
1 files changed, 5 insertions, 5 deletions
diff --git a/std/thread.zc b/std/thread.zc
index 0ebcd03..e90943b 100644
--- a/std/thread.zc
+++ b/std/thread.zc
@@ -73,14 +73,14 @@ struct Thread {
impl Thread {
fn spawn(func: fn()) -> Result<Thread> {
- var t: usize = 0;
+ let t: usize = 0;
- var ctx_copy = malloc(16); // z_closure_T is 16 bytes
+ let ctx_copy = malloc(16); // z_closure_T is 16 bytes
if (ctx_copy == NULL) return Result<Thread>::Err("OOM");
memcpy(ctx_copy, &func, 16);
- var ret = _z_thread_spawn(ctx_copy, &t);
+ let ret = _z_thread_spawn(ctx_copy, &t);
if (ret != 0) {
free(ctx_copy);
@@ -91,7 +91,7 @@ impl Thread {
}
fn join(self) -> Result<bool> {
- var ret = _z_thread_join(self.handle);
+ let ret = _z_thread_join(self.handle);
if (ret != 0) return Result<bool>::Err("Join failed");
return Result<bool>::Ok(true);
}
@@ -103,7 +103,7 @@ struct Mutex {
impl Mutex {
fn new() -> Mutex {
- var ptr = malloc(64);
+ let ptr = malloc(64);
_z_mutex_init(ptr);
return Mutex { handle: ptr };
}