Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Protect individual sources with spinlocks.
While the mixer thread is using a specific source, it locks it, and the public API might grab the lock to set a few variables. Mostly this protects against losing the SDL_AudioStream while using it, or scheduling sources to play at all; most other things can just deal with being async. In the case of no lock contention, this is just the cost of a single atomic compare-and-swap operation (after function call overhead into SDL, of course). This can probably be more fine-grained than this, but this is an acceptable bit of overhead for now.
- Loading branch information
Showing
1 changed file
with
89 additions
and
67 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