Wiki Page Content

Differences between revisions 7 and 8
Revision 7 as of 2011-03-10 23:15:44
Size: 956
Editor: SheenaSmith
Comment: added Remark in response to Feedback
Revision 8 as of 2013-07-14 07:04:09
Size: 1095
Editor: RainerDeyke
Comment: Added explanation of the relationship between SDL_LockAudio and SDL_LockAudioDevice.
Deletions are marked like this. Additions are marked like this.
Line 20: Line 20:
The lock manipulated by these functions protects the callback function. During an [[SDL_LockAudio]]()/[[SDL_UnlockAudio]]() pair you can be guaranteed that the callback function for the default audio device is not running. The lock manipulated by these functions protects the callback function. During an [[SDL_LockAudio]]()/[[SDL_UnlockAudio]]() pair you can be guaranteed that the callback function for the default audio device is not running. Use [[SDL_LockAudioDevice]] if you need to lock a different audio device. [[SDL_LockAudio]]() is equivalent to [[SDL_LockAudioDevice]](1).

SDL_LockAudio

Use this function to lock out the audio callback function.

Syntax

void SDL_LockAudio(void)

Code Examples

You can add your code example here

Remarks

The lock manipulated by these functions protects the callback function. During an SDL_LockAudio()/SDL_UnlockAudio() pair you can be guaranteed that the callback function for the default audio device is not running. Use SDL_LockAudioDevice if you need to lock a different audio device. SDL_LockAudio() is equivalent to SDL_LockAudioDevice(1).

SDL_LockAudio() is not a re-entrant function and can potentially block if it is called more than once from the same thread before a call to SDL_Unlock() is made.

Do not call these from the callback function or you will cause deadlock.


CategoryAPI, CategoryAudio

None: SDL_LockAudio (last edited 2015-01-09 23:01:38 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit