术语 | setthreadpoolcallbacklibrary |
释义 | SetThreadpoolCallbackLibrary 语法: C++ VOID SetThreadpoolCallbackLibrary( __inout PTP_CALLBACK_ENVIRON pcbe, __in PVOID mod ); SetThreadpoolCallbackLibrary功能 确保保持加载指定的DLL,只要有优秀的回调。 参数 pcbe [ in , out ] 阿TP_CALLBACK_ENVIRON结构,它定义回调环境。该InitializeThreadpoolEnvironment函数返回这个结构。 国防部 [in] 句柄到DLL。 返回值 这个函数没有返回值。 备注 您应该调用这个函数,如果回调可能获得加载器锁。这可以防止当一个人在DllMain线程正在等待回调结束出现僵局,另一个线程正在执行的回调试图获取加载器锁。 如果DLL包含回调可能是卸货时,在DllMain清理代码发布前必须取消该对象未回调。 此功能是比较昂贵的。您也应该考虑确保库不卸载而回调正在执行,或以保证回调的可能执行不获取加载器锁其他选项。 这个功能是作为一个内联函数。 要编译的应用程序使用此函数,定义为0x0600或更高_WIN32_WINNT。 要求: client最低支持Vista server最低支持 Windows Server 2008 HeaderWinbase.h(头文件:winuser.h) 参见 DestroyThreadpoolEnvironment FreeLibraryWhenCallbackReturns InitializeThreadpoolEnvironment SetThreadpoolCallbackCleanupGroup SetThreadpoolCallbackPool SetThreadpoolCallbackRunsLong 线程池 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==SetThreadpoolCallbackLibrary Function Ensures that the specified DLL remains loaded as long as there are outstanding callbacks. Syntax C++ VOID SetThreadpoolCallbackLibrary( __inout PTP_CALLBACK_ENVIRON pcbe, __in PVOID mod ); Parameters pcbe [in, out] A TP_CALLBACK_ENVIRON structure that defines the callback environment. The InitializeThreadpoolEnvironment function returns this structure. mod [in] A handle to the DLL. Return Value This function does not return a value. Remarks You should call this function if a callback might acquire the loader lock. This prevents a deadlock from occurring when one thread in DllMain is waiting for the callback to end, and another thread that is executing the callback attempts to acquire the loader lock. If the DLL containing the callback might be unloaded, the cleanup code in DllMain must cancel outstanding callbacks before releasing the object. This function is somewhat expensive. You should consider other options for ensuring that the library is not unloaded while callbacks are executing, or to guarantee that callbacks which may be executing do not acquire the loader lock. This function is implemented as an inline function. To compile an application that uses this function, define _WIN32_WINNT as 0x0600 or higher. Requirements Minimum supported clientWindows Vista Minimum supported serverWindows Server 2008 HeaderWinbase.h (include Windows.h) See Also DestroyThreadpoolEnvironment FreeLibraryWhenCallbackReturns InitializeThreadpoolEnvironment SetThreadpoolCallbackCleanupGroup SetThreadpoolCallbackPool SetThreadpoolCallbackRunsLong Thread Pools Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms686258(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。