术语 | createthreadpoolwait |
释义 | CreateThreadpoolWait 语法: C++ PTP_WAIT WINAPI CreateThreadpoolWait( __in PTP_WAIT_CALLBACK pfnwa, __inout_opt PVOID pv, __in_opt PTP_CALLBACK_ENVIRON pcbe ); CreateThreadpoolWait功能 创建一个新的等待对象。 参数 pfnwa [in] 回调函数调用时,等待完成或超时。详情见WaitCallback。 光伏[中,指出,可选] 可选应用程序定义的数据传递给回调函数。 pcbe [中,可选] 阿TP_CALLBACK_ENVIRON结构,它定义的环境中执行回调。该InitializeThreadpoolEnvironment函数返回这个结构。 如果该参数为NULL,回调执行在默认的回调环境。有关更多信息,请参阅InitializeThreadpoolEnvironment。 返回值 如果函数成功,它返回一个TP_WAIT结构,它定义等待的对象。 如果函数失败,返回NULL。要检索扩展的错误信息,调用GetLastError。 备注 要设置等对象,调用SetThreadpoolWait功能。 工作项和所有职能它呼吁必须是线程池安全。因此,您不能调用一个异步调用默认的回调环境,需要一个持久的线程,如RegNotifyChangeKeyValue功能。相反,设置线程池的最大等于最小线程池使用SetThreadpoolThreadMaximum和SetThreadpoolThreadMinimum功能,或创建自己的线程使用CreateThread函数。 要编译的应用程序使用此函数,定义为0x0600或更高_WIN32_WINNT。 实例 有关示例,请参阅使用线程池功能。 要求: client最低支持Vista server最低支持 Windows Server 2008 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 CloseThreadpoolWait SetThreadpoolWait 线程池 WaitForThreadpoolWaitCallbacks 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==CreateThreadpoolWait Function Creates a new wait object. Syntax C++ PTP_WAIT WINAPI CreateThreadpoolWait( __in PTP_WAIT_CALLBACK pfnwa, __inout_opt PVOID pv, __in_opt PTP_CALLBACK_ENVIRON pcbe ); Parameters pfnwa [in] The callback function to call when the wait completes or times out. For details, see WaitCallback . 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. 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 a TP_WAIT structure that defines the wait object. If the function fails, it returns NULL. To retrieve extended error information, call GetLastError . Remarks To set the wait object, call the SetThreadpoolWait function. The work item and all functions it calls must be thread-pool safe. Therefore, you cannot call an asynchronous call that requires a persistent thread, such as the RegNotifyChangeKeyValue function, from the default callback environment. Instead, set the thread pool maximum equal to the thread pool minimum using the SetThreadpoolThreadMaximum and SetThreadpoolThreadMinimum functions, or create your own thread using the CreateThread function. To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher. Examples For an example, see Using the Thread Pool Functions . Requirements Minimum supported clientWindows Vista Minimum supported serverWindows Server 2008 HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also CloseThreadpoolWait SetThreadpoolWait Thread Pools WaitForThreadpoolWaitCallbacks Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms682474(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。