Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race conditions in NotePlayHandleManager (LMMS#4966)
NotePlayHandleManager::acquire uses a read lock unless the pool is empty. If two threads try to acquire NotePlayHandle simultaneously when the value of s_availableIndex is 1, one thread will try to read s_available[-1]. If the acquire action and the release action are done at the same time, NotePlayHandleManager::acquire may try to read data before NotePlayHandleManager::release actually writes. This commit prevents them by always using the write lock when acquiring a NotePlayHandle.
- Loading branch information