TrySubmitThreadpoolCallback function
Requests that a thread pool worker thread call the specified callback function.
Syntax
BOOL WINAPI TrySubmitThreadpoolCallback( _In_ PTP_SIMPLE_CALLBACK pfns, _Inout_opt_ PVOID pv, _In_opt_ PTP_CALLBACK_ENVIRON pcbe );
Parameters
- pfns [in]
-
The callback function. For details, see SimpleCallback.
- pv [in, out, optional]
-
Optional application-defined data to pass to the callback function.
- pcbe [in, optional]
-
A TP_CALLBACK_ENVIRON structure that defines the environment in which to execute the callback function. The InitializeThreadpoolEnvironment function returns this structure.
If this parameter is NULL, the callback executes in the default callback environment. For more information, see InitializeThreadpoolEnvironment.
Return value
If the function succeeds, it returns TRUE.
If the function fails, it returns FALSE. To retrieve extended error information, call GetLastError.
Remarks
To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- CallbackMayRunLong
- DisassociateCurrentThreadFromCallback
- FreeLibraryWhenCallbackReturns
- InitializeThreadpoolEnvironment
- LeaveCriticalSectionWhenCallbackReturns
- ReleaseMutexWhenCallbackReturns
- ReleaseSemaphoreWhenCallbackReturns
- SetEventWhenCallbackReturns
- Thread Pools