diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-06-28 23:17:20 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-06-28 23:17:20 +0100 |
| commit | 0622509807993e02ab9ed155f1864198fd180bf9 (patch) | |
| tree | b6a7e0868565ac26aebf8f841b5c9e48f7a7aead /core/sync_linux.odin | |
| parent | 9ca2246bac823022f39d495398456bcb142d50b9 (diff) | |
Disable `var` and `const` declarations
Diffstat (limited to 'core/sync_linux.odin')
| -rw-r--r-- | core/sync_linux.odin | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/sync_linux.odin b/core/sync_linux.odin index c3fc649b9..387c0164d 100644 --- a/core/sync_linux.odin +++ b/core/sync_linux.odin @@ -49,7 +49,7 @@ proc mutex_destroy(m: ^Mutex) { semaphore_destroy(&m._semaphore); } proc mutex_lock(m: ^Mutex) { - var thread_id = current_thread_id(); + thread_id := current_thread_id(); if atomics.fetch_add(&m._counter, 1) > 0 { if thread_id != atomics.load(&m._owner) { semaphore_wait(&m._semaphore); @@ -59,11 +59,11 @@ proc mutex_lock(m: ^Mutex) { m._recursion++; } proc mutex_try_lock(m: ^Mutex) -> bool { - var thread_id = current_thread_id(); + thread_id := current_thread_id(); if atomics.load(&m._owner) == thread_id { atomics.fetch_add(&m._counter, 1); } else { - var expected: i32 = 0; + expected: i32 = 0; if atomics.load(&m._counter) != 0 { return false; } @@ -76,8 +76,8 @@ proc mutex_try_lock(m: ^Mutex) -> bool { return true; } proc mutex_unlock(m: ^Mutex) { - var recursion: i32; - var thread_id = current_thread_id(); + recursion: i32; + thread_id := current_thread_id(); assert(thread_id == atomics.load(&m._owner)); m._recursion--; |