-
Notifications
You must be signed in to change notification settings - Fork 6
MBX-3295: fixed dead lock #450
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
| mindboxScope.launch { | ||
| mutex.withLock { | ||
| inAppMutex.withLock { | ||
| InitializeLock.await(InitializeLock.State.SAVE_MINDBOX_CONFIG) |
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.
А уверены что InitializeLock.await(InitializeLock.State.SAVE_MINDBOX_CONFIG) не надо вынести?
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.
Проблема же в использовании того же самого mutex, метод аффектил из-за этого
Возможно я что-то не понимаю, дождемся Роберта
В целом проверил на экзампле - "смоук" ок
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.
Мне просто не нравится идея одного lock в другом lock. Никто не мешает нам подождать до mutex
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.
Я бы и вынес InitializeLock и заменил mutex, оба решения
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.
Лок в локе можно вынести, если это не хорошо выглядит, но конкретно здесь проблема только в том, что лок внутри мьютекса и мьютекс один и тот же. И на самом деле даже каждое решение по отдельности даже решит проблему. Можно и оба
https://github.com/mindbox-cloud/issues-web-mobile/issues/3295