-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[raudio] Fix 3664: crash in raudio from multithreading issues (#3907)
* Flip release of buffer; First it needs to be taken out of the processing chain, then it can be released. The inverse of the initialization. * Add mutex locks to audio buffer functions; Separate those used from both threads * Flip release of buffer; First it needs to be taken out of the processing chain, then it can be released. The inverse of the initialization. * Remove TODO marker; The buffer is in stopped state and its data won't be accessed * Add mutex locks to music/stream functions directly operating on buffer * Secure UpdateMusicStream/PlayMusicStream/UpdateAudioStream; This change is twofold: * Add locks to UpdateMusicStream/UpdateAudioStream (second one needed separation) * Remove unnecessary hack to restart music - inlining the statements resulted in a no-op Especially the second part made it easier to ensure thread-safety overall * Remove redundant check; Already checked at beginning of function
- Loading branch information
Showing
1 changed file
with
92 additions
and
32 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