Skip to content

Commit f9e55a1

Browse files
committed
[Concurrency] Always assume that if expecting main actor and are on main thread that this is equal
1 parent d032588 commit f9e55a1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -387,17 +387,9 @@ static bool swift_task_isCurrentExecutorImpl(SerialExecutorRef expectedExecutor)
387387
// the expected executor however, so we need to try a bit harder before
388388
// we fail.
389389

390-
// Legacy special handling the main executor by detecting the main thread.
391-
//
392-
// When 'checkIsolated' is available it will perform a dispatch queue assertion
393-
// against the main queue, potentially resulting in a crash (expected).
394-
//
395-
// In legacy mode, we cannot allow crashes here, and therefore we keep the
396-
// special best-effort handling of the "main thread".
397-
if (isCurrentExecutorMode == Legacy_NoCheckIsolated_NonCrashing) {
398-
if (expectedExecutor.isMainExecutor() && isExecutingOnMainThread()) {
399-
return true;
400-
}
390+
// Special handling the main executor by detecting the main thread.
391+
if (expectedExecutor.isMainExecutor() && isExecutingOnMainThread()) {
392+
return true;
401393
}
402394

403395
// We cannot use 'complexEquality' as it requires two executor instances,

0 commit comments

Comments
 (0)