Skip to content

Commit 5c9d587

Browse files
committed
zephyr: sys: sync: semaphore: Remove a few 'mut' declarations
The semaphore API shouldn't have `&mut self` declarations, as the purpose of the API is to be that thread synchronization. Even the less save ones, such as `count_get` and `reset` have well defined multi-threaded behavior. Signed-off-by: David Brown <[email protected]>
1 parent d0a2e25 commit 5c9d587

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zephyr/src/sys/sync/semaphore.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ impl Semaphore {
106106
/// `Error(EAGAIN)`.
107107
///
108108
/// [`take`]: Self::take
109-
pub fn reset(&mut self) {
109+
pub fn reset(&self) {
110110
unsafe { k_sem_reset(self.item.get()) }
111111
}
112112

113113
/// Get a semaphore's count.
114114
///
115115
/// Returns the current count.
116-
pub fn count_get(&mut self) -> usize {
116+
pub fn count_get(&self) -> usize {
117117
unsafe { k_sem_count_get(self.item.get()) as usize }
118118
}
119119
}

0 commit comments

Comments
 (0)