ISpThreadControl::WaitForThreadDone

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpThreadControl::WaitForThreadDone

ISpThreadControl::WaitForThreadDone specifies the time interval to wait before ending thread processing.

A thread can be forced to stop running or can wait until the thread stops running.

HRESULT WaitForThreadDone(
   BOOL       fForceStop, 
   HRESULT   *phrThreadResult, 
   ULONG      msTimeOut
);

Parameters

fForceStop
Flag specifies to stop thread processing. If this is TRUE, ISpThreadTask::ThreadProc will be called on the thread proc of the worker thread. The ThreadProc parameters of hExitThreadEvent handle will be filled out and pfContinueProcessing flag set to FALSE.
phrThreadResult
If this function returns S_OK, this address will contain the value returned from the thread proc.
msTimeOut
Time-out interval in milliseconds to wait before timing out the wait operation.

Return values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more parameters are invalid.

Remarks

Specifying fForceStop=TRUE with a timeout of zero will simply request that the thread exit and this method will return immediately. The caller could then wait for the ThreadCompleteEvent using a Win32 wait function.