Why "Applications should not call any system-defined functions frominside a callback function"
The windows CALLBACK functions like the
void CALLBACK waveOutProc(
defined in Waveform API,limited the function call used inside the
CALLBACK function. In MSDN,the waveOutProc is remarked as follow:
Applications should not call any system-defined functions from inside
a callback function, except for EnterCriticalSection,
LeaveCriticalSection, midiOutLongMsg, midiOutShortMsg,
OutputDebugString, PostMessage, PostThreadMessage, SetEvent,
timeGetSystemTime, timeGetTime, timeKillEvent, and timeSetEvent.
Calling other wave functions will cause deadlock.
My question is: why does the waveOutProc callback has that
restriction? what happend in the other system calls such as the mutex
and semaphore series?