mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
Remove unneeded semicolons from the core library
This commit is contained in:
@@ -3,7 +3,7 @@ package sync2
|
||||
import "core:time"
|
||||
|
||||
current_thread_id :: proc "contextless" () -> int {
|
||||
return _current_thread_id();
|
||||
return _current_thread_id()
|
||||
}
|
||||
|
||||
// A Mutex is a mutual exclusion lock
|
||||
@@ -16,17 +16,17 @@ Mutex :: struct {
|
||||
|
||||
// mutex_lock locks m
|
||||
mutex_lock :: proc(m: ^Mutex) {
|
||||
_mutex_lock(m);
|
||||
_mutex_lock(m)
|
||||
}
|
||||
|
||||
// mutex_unlock unlocks m
|
||||
mutex_unlock :: proc(m: ^Mutex) {
|
||||
_mutex_unlock(m);
|
||||
_mutex_unlock(m)
|
||||
}
|
||||
|
||||
// mutex_lock tries to lock m, will return true on success, and false on failure
|
||||
mutex_try_lock :: proc(m: ^Mutex) -> bool {
|
||||
return _mutex_try_lock(m);
|
||||
return _mutex_try_lock(m)
|
||||
}
|
||||
|
||||
// Example:
|
||||
@@ -37,8 +37,8 @@ mutex_try_lock :: proc(m: ^Mutex) -> bool {
|
||||
//
|
||||
@(deferred_in=mutex_unlock)
|
||||
mutex_guard :: proc(m: ^Mutex) -> bool {
|
||||
mutex_lock(m);
|
||||
return true;
|
||||
mutex_lock(m)
|
||||
return true
|
||||
}
|
||||
|
||||
// A RW_Mutex is a reader/writer mutual exclusion lock
|
||||
@@ -53,32 +53,32 @@ RW_Mutex :: struct {
|
||||
// rw_mutex_lock locks rw for writing (with a single writer)
|
||||
// If the mutex is already locked for reading or writing, the mutex blocks until the mutex is available.
|
||||
rw_mutex_lock :: proc(rw: ^RW_Mutex) {
|
||||
_rw_mutex_lock(rw);
|
||||
_rw_mutex_lock(rw)
|
||||
}
|
||||
|
||||
// rw_mutex_unlock unlocks rw for writing (with a single writer)
|
||||
rw_mutex_unlock :: proc(rw: ^RW_Mutex) {
|
||||
_rw_mutex_unlock(rw);
|
||||
_rw_mutex_unlock(rw)
|
||||
}
|
||||
|
||||
// rw_mutex_try_lock tries to lock rw for writing (with a single writer)
|
||||
rw_mutex_try_lock :: proc(rw: ^RW_Mutex) -> bool {
|
||||
return _rw_mutex_try_lock(rw);
|
||||
return _rw_mutex_try_lock(rw)
|
||||
}
|
||||
|
||||
// rw_mutex_shared_lock locks rw for reading (with arbitrary number of readers)
|
||||
rw_mutex_shared_lock :: proc(rw: ^RW_Mutex) {
|
||||
_rw_mutex_shared_lock(rw);
|
||||
_rw_mutex_shared_lock(rw)
|
||||
}
|
||||
|
||||
// rw_mutex_shared_unlock unlocks rw for reading (with arbitrary number of readers)
|
||||
rw_mutex_shared_unlock :: proc(rw: ^RW_Mutex) {
|
||||
_rw_mutex_shared_unlock(rw);
|
||||
_rw_mutex_shared_unlock(rw)
|
||||
}
|
||||
|
||||
// rw_mutex_try_shared_lock tries to lock rw for reading (with arbitrary number of readers)
|
||||
rw_mutex_try_shared_lock :: proc(rw: ^RW_Mutex) -> bool {
|
||||
return _rw_mutex_try_shared_lock(rw);
|
||||
return _rw_mutex_try_shared_lock(rw)
|
||||
}
|
||||
|
||||
// Example:
|
||||
@@ -89,8 +89,8 @@ rw_mutex_try_shared_lock :: proc(rw: ^RW_Mutex) -> bool {
|
||||
//
|
||||
@(deferred_in=rw_mutex_unlock)
|
||||
rw_mutex_guard :: proc(m: ^RW_Mutex) -> bool {
|
||||
rw_mutex_lock(m);
|
||||
return true;
|
||||
rw_mutex_lock(m)
|
||||
return true
|
||||
}
|
||||
|
||||
// Example:
|
||||
@@ -101,8 +101,8 @@ rw_mutex_guard :: proc(m: ^RW_Mutex) -> bool {
|
||||
//
|
||||
@(deferred_in=rw_mutex_shared_unlock)
|
||||
rw_mutex_shared_guard :: proc(m: ^RW_Mutex) -> bool {
|
||||
rw_mutex_shared_lock(m);
|
||||
return true;
|
||||
rw_mutex_shared_lock(m)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -116,15 +116,15 @@ Recursive_Mutex :: struct {
|
||||
}
|
||||
|
||||
recursive_mutex_lock :: proc(m: ^Recursive_Mutex) {
|
||||
_recursive_mutex_lock(m);
|
||||
_recursive_mutex_lock(m)
|
||||
}
|
||||
|
||||
recursive_mutex_unlock :: proc(m: ^Recursive_Mutex) {
|
||||
_recursive_mutex_unlock(m);
|
||||
_recursive_mutex_unlock(m)
|
||||
}
|
||||
|
||||
recursive_mutex_try_lock :: proc(m: ^Recursive_Mutex) -> bool {
|
||||
return _recursive_mutex_try_lock(m);
|
||||
return _recursive_mutex_try_lock(m)
|
||||
}
|
||||
|
||||
|
||||
@@ -136,8 +136,8 @@ recursive_mutex_try_lock :: proc(m: ^Recursive_Mutex) -> bool {
|
||||
//
|
||||
@(deferred_in=recursive_mutex_unlock)
|
||||
recursive_mutex_guard :: proc(m: ^Recursive_Mutex) -> bool {
|
||||
recursive_mutex_lock(m);
|
||||
return true;
|
||||
recursive_mutex_lock(m)
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -150,19 +150,19 @@ Cond :: struct {
|
||||
}
|
||||
|
||||
cond_wait :: proc(c: ^Cond, m: ^Mutex) {
|
||||
_cond_wait(c, m);
|
||||
_cond_wait(c, m)
|
||||
}
|
||||
|
||||
cond_wait_with_timeout :: proc(c: ^Cond, m: ^Mutex, timeout: time.Duration) -> bool {
|
||||
return _cond_wait_with_timeout(c, m, timeout);
|
||||
return _cond_wait_with_timeout(c, m, timeout)
|
||||
}
|
||||
|
||||
cond_signal :: proc(c: ^Cond) {
|
||||
_cond_signal(c);
|
||||
_cond_signal(c)
|
||||
}
|
||||
|
||||
cond_broadcast :: proc(c: ^Cond) {
|
||||
_cond_broadcast(c);
|
||||
_cond_broadcast(c)
|
||||
}
|
||||
|
||||
|
||||
@@ -177,9 +177,9 @@ Sema :: struct {
|
||||
|
||||
|
||||
sema_wait :: proc(s: ^Sema) {
|
||||
_sema_wait(s);
|
||||
_sema_wait(s)
|
||||
}
|
||||
|
||||
sema_post :: proc(s: ^Sema, count := 1) {
|
||||
_sema_post(s, count);
|
||||
_sema_post(s, count)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user