ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

MMRESULT TerminateSoundThread ( IN PSOUND_THREAD  Thread)

Definition at line 119 of file thread.c.

Referenced by DestroySoundThread().

{
    DWORD WaitResult;

    SND_ASSERT( Thread );

    SND_TRACE(L"Waiting for READY event\n");
    WaitForSingleObject(Thread->Events.Ready, INFINITE);

    Thread->Request.Result = MMSYSERR_NOTSUPPORTED;
    Thread->Request.Handler = SoundThreadTerminator;
    Thread->Request.SoundDeviceInstance = NULL;
    Thread->Request.Parameter = (PVOID) Thread;

    /* Notify the thread it has work to do */
    SND_TRACE(L"Setting REQUEST event\n");
    SetEvent(Thread->Events.Request);

    /* Wait for the work to be done */
    SND_TRACE(L"Waiting for DONE event\n");
    WaitForSingleObject(Thread->Events.Done, INFINITE);

    /* Wait for the thread to actually end */
    WaitResult = WaitForSingleObject(Thread->Handle, INFINITE);
    SND_ASSERT( WaitResult == WAIT_OBJECT_0 );

    /* Close the thread and invalidate the handle */
    CloseHandle(Thread->Handle);    /* Is this needed? */
    Thread->Handle = INVALID_HANDLE_VALUE;

    return MMSYSERR_NOERROR;
}

Generated on Sun May 27 2012 05:11:41 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.