Skip to content

runBlocking doesnt block Main thread on iOS #4345

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

Open
slipdef opened this issue Feb 7, 2025 · 1 comment
Open

runBlocking doesnt block Main thread on iOS #4345

slipdef opened this issue Feb 7, 2025 · 1 comment

Comments

@slipdef
Copy link

slipdef commented Feb 7, 2025

We used to use our custom implementation to run some important cleaning procedure on applicationWillTerminate event on iOS. The procedure requires suspend func invocation, so we use custom runblocking that uses NSRunLoop.mainRunLoop inside. I noticed that coroutines in latest versions provides own impl of runBlocking for Native. The test reveals that it doesnt block the thread (MainThread) in applicationWillTerminate.

@slipdef slipdef added the bug label Feb 7, 2025
@dkhalanskyjb
Copy link
Collaborator

Sorry, could you explain what you mean? Could you maybe provide a code example? runBlocking is itself not a suspend function, so it certainly blocks the thread it's running on.

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

No branches or pull requests

2 participants