Skip to content

Commit 9ef0e37

Browse files
committed
Fix moved value.
1 parent 072b940 commit 9ef0e37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/sys/unix/freertos/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ impl Thread {
3131
pub unsafe fn new(name: Option<&CStr>, stack: usize, p: Box<dyn FnOnce()>)
3232
-> io::Result<Thread> {
3333
let join_mutex = Arc::new(Mutex::new());
34+
join_mutex.lock();
3435
let state = Arc::new(AtomicUsize::new(RUNNING));
3536

3637
let arg = box (join_mutex.clone(), state.clone(), box p);
@@ -39,7 +40,6 @@ impl Thread {
3940

4041
let mut thread = Thread { id: ptr::null_mut(), join_mutex, state };
4142

42-
join_mutex.lock();
4343

4444
let res = xTaskCreate(
4545
thread_start,

0 commit comments

Comments
 (0)