Commit 390c4b9
committed
sys/pal/unix/sync/mutex: Fix Mutex::new() on NuttX
PTHREAD_MUTEX_INITIALIZER is highly configurable on NuttX, making it difficult
to use a hardcoded initializer from libc crate in Rust way.
Instead, call pthread_mutex_init() to initialize the mutex with default attributes, ensuring consistent behavior
with PTHREAD_MUTEX_INITIALIZER.
* Added conditional compilation for NuttX target
* Replaced PTHREAD_MUTEX_INITIALIZER with pthread_mutex_init() for NuttX
* Ensured consistent mutex initialization behavior across platforms1 parent 57a4736 commit 390c4b9
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
16 | 32 | | |
17 | 33 | | |
18 | 34 | | |
| |||
0 commit comments