WaveOut (Win32API) and multithreading

I cannot find any thread safety information for the waveOut API.

After creating a new waveOut descriptor, I have these threads:

Topic 1: Buffer Processing. Uses these API functions:

  • waveOutPrepareHeader
  • waveOutWrite
  • waveOutUnprepareHeader

Topic 2: Gui, Controller thread. Uses these API functions:

  • waveOutPause
  • waveOutRestart
  • waveOutReset
  • waveOutBreakLoop

These two threads work while using the same waveOut descriptor. In my tests, I did not see any problems with functionality, but this does not mean that it is safe.

Is this architecture thread safe? Is there any thread safety documentation for the waveOut API? Any other suggestions for waveOut API thread safety?

thank.

+3
4

API waveOut . waveOutOpen() , waveOut * . ...

, :

  • , dwBufferThreadId
  • GUI waveOutOpen dwCallback dwBufferThreadId fdwOpen CALLBACK_THREAD
  • : "waveOutWrite" , GetMessage()
  • waveOutOpen WOM_DONE , , , waveOutWrite .
  • waveOutPause, waveOutRestart .. ( MSDN , , ).

1

100% , Windows (WM_USER + 0) PostThreadMessage( WM_USER+0, dwBufferThreadId, MY_CTL_PAUSE,0 ), waveOutPause(). Windows ; -)

+4

, , waveOutWrite WaveOutRestart .

VS2010 Beta2, , , , , ..

Visual Studio 2010 ( ), -, , . , 2 , , , Win32 std:: queue...

, .

+2

, . :

waveOutWrite() ?

Microsoft , . .

+2

, ( ) , , , , , . EnterCriticalSection/LeaveCriticalSection, , .

, API : . , Microsoft .

- , Microsoft Intel .

+1
source

Source: https://habr.com/ru/post/1725222/


All Articles