Skip to content

Commit faaf5fb

Browse files
committed
Only set EXITED when current state is RUNNING.
1 parent 3850705 commit faaf5fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl Thread {
8282
main();
8383
thread_local::cleanup();
8484

85-
let previous_state = state.swap(EXITED, SeqCst);
85+
let previous_state = state.compare_and_swap(RUNNING, EXITED, SeqCst);
8686

8787
join_mutex.unlock();
8888

0 commit comments

Comments
 (0)