NXC
Not eXactly C
Topics
Threads
PlaySound() is not thread safe.
Keywords
- PlaySound is not thread safe. If you call it from more than one simultaneous task, some tasks may block. A workaround is
to define the wrapper function below, then call that function instead of calling PlaySound.
// inline to get around PlaySound not being threadsafe
mutex __muPlaySound;
inline void safePlaySound(int sound) {
Acquire(__muPlaySound);
PlaySound(sound);
Release(__muPlaySound);
}
External Links
page revision: 3, last edited: 22 Feb 2015 23:55