mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-11-30 09:44:28 +00:00
Use atomics for thread cancellation
This commit is contained in:
1 parent
7d884fadc3
commit
c3360b7102
2 files changed
+8
-6
No files matched your search
+2
-2
@@ -211,11 +211,11 @@ void PltDetachThread(PLT_THREAD* thread) {
|
||||
}
|
||||
|
||||
bool PltIsThreadInterrupted(PLT_THREAD* thread) {
|
||||
return thread->cancelled;
|
||||
return atomic_load_explicit(&thread->cancelled, memory_order_acquire);
|
||||
}
|
||||
|
||||
void PltInterruptThread(PLT_THREAD* thread) {
|
||||
thread->cancelled = true;
|
||||
atomic_store_explicit(&thread->cancelled, true, memory_order_release);
|
||||
}
|
||||
|
||||
#ifdef __WIIU__
|
||||
|
||||
Reference in new issue
Block a user