-
Notifications
You must be signed in to change notification settings - Fork 78
More API and documentation cleanups #954
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
Conversation
68436ee to
ee8093f
Compare
| let system = self.actorSystem | ||
| system?.shutdownLock.lock() | ||
| defer { | ||
| system?.shutdownLock.unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktoso this isn't legal code because you may lock and unlock on different threads which is UB and will likely crash. So you can never hold a mutex/lock across an await. I'd recommend only using the withLock { ... } version which will prevent you from doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh boy, you're right of course -- moving to DispatchSemaphore. Thanks for spotting this!
No description provided.