次の方法で共有


ISpThreadControl::WaitForThreadDone (Windows Embedded CE 6.0)

1/6/2010

This method requests a thread to stop running, waits until the thread stops running, or both. Setting fForceStop to TRUE with a timeout of zero simply requests the thread to exit, and allows the method to return immediately. The caller can then wait for a ThreadCompleteEvent using a Win32 wait function.

Syntax

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

Parameters

  • fForceStop
    [in] Value indicating if the method is to stop thread processing. Set this value to TRUE to stop processing, and to FALSE otherwise. If processing is to be stopped, the ISpThreadTask::ThreadProc method is called with hExitThreadEvent set and pfContinueProcessing set to FALSE for the worker thread.
  • phrThreadResult
    [out] Pointer to the value returned from ISpThreadTask::ThreadProc function if WaitForThreadDone returns S_OK.
  • msTimeOut
    [in] Timeout interval, in milliseconds, to wait before timing out the wait operation.

Return Value

The following table shows the possible return values.

Value Description

S_OK

Function completed successfully.

E_INVALIDARG

One or more arguments are invalid.

Requirements

Header sapiddk.h, sapiddk.idl
Library sapilib.lib
Windows Embedded CE Windows CE .NET 4.1 and later

See Also

Reference

ISpThreadControl
SAPI Interfaces