Skip to content

Thread.isMainThread unnecessarily marked noasync #5140

Open
@weissi

Description

@weissi

@available(*, noasync)
open var isMainThread: Bool {

Thread.isMainThread is an important debugging tool, it should absolutely be available in noasync contexts.

Sure, the work around is just

extension Thread {
    static var isThisTheMainThread: Bool {
        return Thread.isMainThread
    }
}

but we shouldn't need to write this code.

Related to #5139

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions