Thread.isMainThread throwing compiler warnings

While I do think it's a bit too aggressive to ban that property entirely...

The new world™ replacement for this is coming over here: SE-0471: Improved Custom SerialExecutor isolation checking for Concurrency Runtime

Via this you'd be able to check if you're on some executor, including the "main actor's executor".

The main actor is not necessarily the main thread (though most of the time it is).

2 Likes