Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MessageManager: Improve thread safety of Lock type
Previously, the following sequence of events was possible: Background thread Main thread ------------------------------------------------------------------------ Lock::tryAcquire() Run to blockingMessage->post() BlockingMessage::messageCallback() Run to abortWait.set (1) Lock::tryAcquire() Exit through return true Lock::~Lock() Destroy memory used for Lock BlockingMessage::messageCallback() Execute lockedEvent.signal() Memory already freed, crash
- Loading branch information
Showing
2 changed files
with
59 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters