From 7d1944ab9d2307f2736afe8520436872db1c7617 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sun, 25 Jan 2026 15:12:12 +0000 Subject: 'let' it be --- std/thread.zc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'std/thread.zc') 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 { - 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::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 { - var ret = _z_thread_join(self.handle); + let ret = _z_thread_join(self.handle); if (ret != 0) return Result::Err("Join failed"); return Result::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 }; } -- cgit v1.2.3