diff options
| author | gingerBill <bill@gingerbill.org> | 2022-01-19 17:15:10 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-01-19 17:15:10 +0000 |
| commit | 2b918ada4bd640f9b0057f2ae4213fb73cae6ac5 (patch) | |
| tree | 72e94661ae302821b2f0867dddb7cfb81c248bae /core/sync/sync2 | |
| parent | b5754b6ed9082bb729ea5d18a926c723e52f377f (diff) | |
Add `.Private` information to doc-format
Diffstat (limited to 'core/sync/sync2')
| -rw-r--r-- | core/sync/sync2/primitives.odin | 50 | ||||
| -rw-r--r-- | core/sync/sync2/primitives_atomic.odin | 51 | ||||
| -rw-r--r-- | core/sync/sync2/sema_internal.odin | 1 | ||||
| -rw-r--r-- | core/sync/sync2/sync_util.odin | 26 |
4 files changed, 61 insertions, 67 deletions
diff --git a/core/sync/sync2/primitives.odin b/core/sync/sync2/primitives.odin index d9e013664..6d056d439 100644 --- a/core/sync/sync2/primitives.odin +++ b/core/sync/sync2/primitives.odin @@ -29,12 +29,12 @@ mutex_try_lock :: proc(m: ^Mutex) -> bool { return _mutex_try_lock(m) } -// Example: -// -// if mutex_guard(&m) { -// ... -// } -// +/* +Example: + if mutex_guard(&m) { + ... + } +*/ @(deferred_in=mutex_unlock) mutex_guard :: proc(m: ^Mutex) -> bool { mutex_lock(m) @@ -80,25 +80,24 @@ rw_mutex_shared_unlock :: proc(rw: ^RW_Mutex) { rw_mutex_try_shared_lock :: proc(rw: ^RW_Mutex) -> bool { return _rw_mutex_try_shared_lock(rw) } - -// Example: -// -// if rw_mutex_guard(&m) { -// ... -// } -// +/* +Example: + if rw_mutex_guard(&m) { + ... + } +*/ @(deferred_in=rw_mutex_unlock) rw_mutex_guard :: proc(m: ^RW_Mutex) -> bool { rw_mutex_lock(m) return true } -// Example: -// -// if rw_mutex_shared_guard(&m) { -// ... -// } -// +/* +Example: + if rw_mutex_shared_guard(&m) { + ... + } +*/ @(deferred_in=rw_mutex_shared_unlock) rw_mutex_shared_guard :: proc(m: ^RW_Mutex) -> bool { rw_mutex_shared_lock(m) @@ -127,13 +126,12 @@ recursive_mutex_try_lock :: proc(m: ^Recursive_Mutex) -> bool { return _recursive_mutex_try_lock(m) } - -// Example: -// -// if recursive_mutex_guard(&m) { -// ... -// } -// +/* +Example: + if recursive_mutex_guard(&m) { + ... + } +*/ @(deferred_in=recursive_mutex_unlock) recursive_mutex_guard :: proc(m: ^Recursive_Mutex) -> bool { recursive_mutex_lock(m) diff --git a/core/sync/sync2/primitives_atomic.odin b/core/sync/sync2/primitives_atomic.odin index a13b73a99..5fc6fba85 100644 --- a/core/sync/sync2/primitives_atomic.odin +++ b/core/sync/sync2/primitives_atomic.odin @@ -82,13 +82,12 @@ atomic_mutex_try_lock :: proc(m: ^Atomic_Mutex) -> bool { return ok } - -// Example: -// -// if atomic_mutex_guard(&m) { -// ... -// } -// +/* +Example: + if atomic_mutex_guard(&m) { + ... + } +*/ @(deferred_in=atomic_mutex_unlock) atomic_mutex_guard :: proc(m: ^Atomic_Mutex) -> bool { atomic_mutex_lock(m) @@ -193,25 +192,24 @@ atomic_rw_mutex_try_shared_lock :: proc(rw: ^Atomic_RW_Mutex) -> bool { return false } - -// Example: -// -// if atomic_rw_mutex_guard(&m) { -// ... -// } -// +/* +Example: + if atomic_rw_mutex_guard(&m) { + ... + } +*/ @(deferred_in=atomic_rw_mutex_unlock) atomic_rw_mutex_guard :: proc(m: ^Atomic_RW_Mutex) -> bool { atomic_rw_mutex_lock(m) return true } -// Example: -// -// if atomic_rw_mutex_shared_guard(&m) { -// ... -// } -// +/* +Example: + if atomic_rw_mutex_shared_guard(&m) { + ... + } +*/ @(deferred_in=atomic_rw_mutex_shared_unlock) atomic_rw_mutex_shared_guard :: proc(m: ^Atomic_RW_Mutex) -> bool { atomic_rw_mutex_shared_lock(m) @@ -270,13 +268,12 @@ atomic_recursive_mutex_try_lock :: proc(m: ^Atomic_Recursive_Mutex) -> bool { return true } - -// Example: -// -// if atomic_recursive_mutex_guard(&m) { -// ... -// } -// +/* +Example: + if atomic_recursive_mutex_guard(&m) { + ... + } +*/ @(deferred_in=atomic_recursive_mutex_unlock) atomic_recursive_mutex_guard :: proc(m: ^Atomic_Recursive_Mutex) -> bool { atomic_recursive_mutex_lock(m) diff --git a/core/sync/sync2/sema_internal.odin b/core/sync/sync2/sema_internal.odin index 64fc4ed96..f4027e908 100644 --- a/core/sync/sync2/sema_internal.odin +++ b/core/sync/sync2/sema_internal.odin @@ -1,3 +1,4 @@ +//+private package sync2 import "core:time" diff --git a/core/sync/sync2/sync_util.odin b/core/sync/sync2/sync_util.odin index 853c3c685..013bf511a 100644 --- a/core/sync/sync2/sync_util.odin +++ b/core/sync/sync2/sync_util.odin @@ -1,12 +1,11 @@ package sync2 - -// Example: -// -// if guard(&m) { -// ... -// } -// +/* +Example: + if guard(&m) { + ... + } +*/ guard :: proc{ mutex_guard, rw_mutex_guard, @@ -17,13 +16,12 @@ guard :: proc{ atomic_recursive_mutex_guard, atomic_rw_mutex_guard, } - -// Example: -// -// if shared_guard(&m) { -// ... -// } -// +/* +Example: + if shared_guard(&m) { + ... + } +*/ shared_guard :: proc{ rw_mutex_shared_guard, atomic_rw_mutex_shared_guard, |