We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cdf4a6 commit 56f1d31Copy full SHA for 56f1d31
samples/philosophers/src/sysmutex.rs
@@ -10,7 +10,6 @@ use crate::{
10
ForkSync,
11
NUM_PHIL,
12
};
13
-use zephyr::kobj_define;
14
use zephyr::sys::sync::Mutex;
15
use zephyr::time::Forever;
16
@@ -27,8 +26,8 @@ pub struct SysMutexSync {
27
26
impl SysMutexSync {
28
#[allow(dead_code)]
29
pub fn new() -> SysMutexSync {
30
- let locks = MUTEXES.each_ref().map(|m| {
31
- m.init_once(()).unwrap()
+ let locks = [(); NUM_PHIL].each_ref().map(|()| {
+ Mutex::new().unwrap()
32
});
33
SysMutexSync { locks }
34
}
@@ -43,7 +42,3 @@ impl ForkSync for SysMutexSync {
43
42
self.locks[index].unlock().unwrap();
44
45
46
-
47
-kobj_define! {
48
- static MUTEXES: [StaticMutex; NUM_PHIL];
49
-}
0 commit comments