mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
use .fetch_or()
This commit is contained in:
@@ -262,9 +262,8 @@ ExceptionOr<void> Worker::postMessage(JSC::JSGlobalObject& state, JSC::JSValue m
|
||||
|
||||
void Worker::terminate()
|
||||
{
|
||||
|
||||
// Don't try to terminate an already terminated worker
|
||||
if (m_terminationFlags & TerminatedFlag) {
|
||||
// Atomically set the TerminateRequestedFlag, and only proceed if the worker wasn't already terminated
|
||||
if (m_terminationFlags.fetch_or(TerminatedFlag) & TerminatedFlag) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user