Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread.isMainThread unnecessarily marked noasync #5140

Open
weissi opened this issue Nov 29, 2024 · 0 comments
Open

Thread.isMainThread unnecessarily marked noasync #5140

weissi opened this issue Nov 29, 2024 · 0 comments
Assignees

Comments

@weissi
Copy link
Contributor

weissi commented Nov 29, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants