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

when cancel a coroutine, Mutex should not be poisoned #13

Closed
Xudong-Huang opened this issue Jan 4, 2018 · 0 comments
Closed

when cancel a coroutine, Mutex should not be poisoned #13

Xudong-Huang opened this issue Jan 4, 2018 · 0 comments
Milestone

Comments

@Xudong-Huang
Copy link
Owner

Xudong-Huang commented Jan 4, 2018

when cancel a coroutine we trigger a cancel panic inside it. This would cause the mutex got poisoned if it not in the wait state. A better and elegant way is to let the mutex finish normally.

this is possible when you hold a mutex guard, and wait for other resources in the coroutine. when the cancel comes, it will run the mutex guard drop in a panicking context while unwind the stack.

and this is only valid in coroutine context, we can't cancel a thread.

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

1 participant