DisableThreadLibraryCalls
2011-12-02 12:45
447 查看
DisableThreadLibraryCalls 的MSDN解释是这样的:
The DisableThreadLibraryCalls function lets a DLL disable the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls.
就是不接收这两个消息,
his can be a useful optimization for multithreaded applications that have many DLLs, frequently create and delete threads, and whose DLLs do not need these thread-level notifications of attachment/detachment.
对多线程应用程序,该函数在有许多DLL,频繁创建和删除线程,并且DLL不需要线程级消息如DLL_THREAD_ATTACH and DLL_THREAD_DETACH时的多线程应用中是很有效的优化。
Do not call this function from a DLL that is linked to the static C run-time library (CRT). The static CRT requires DLL_THREAD_ATTACH and DLL_THREAD_DETATCH notifications to function properly.
不要从一个链接到静态C运行时库(CRT)的DLL调用此功能。静态CRT需要DLL_THREAD_ATTACH和DLL_THREAD_DETATCH通知才能正常工作。
The DisableThreadLibraryCalls function lets a DLL disable the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls.
就是不接收这两个消息,
his can be a useful optimization for multithreaded applications that have many DLLs, frequently create and delete threads, and whose DLLs do not need these thread-level notifications of attachment/detachment.
对多线程应用程序,该函数在有许多DLL,频繁创建和删除线程,并且DLL不需要线程级消息如DLL_THREAD_ATTACH and DLL_THREAD_DETACH时的多线程应用中是很有效的优化。
Do not call this function from a DLL that is linked to the static C run-time library (CRT). The static CRT requires DLL_THREAD_ATTACH and DLL_THREAD_DETATCH notifications to function properly.
不要从一个链接到静态C运行时库(CRT)的DLL调用此功能。静态CRT需要DLL_THREAD_ATTACH和DLL_THREAD_DETATCH通知才能正常工作。
BOOL APIENTRY DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved ) { switch (dwReason) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: { ::DisableThreadLibraryCalls((HMODULE)hModule); } break; } return TRUE; }
相关文章推荐
- DllMain中不当操作导致死锁问题的分析--DisableThreadLibraryCalls对DllMain中死锁的影响
- DisableThreadLibraryCalls 的作用
- DisableThreadLibraryCalls
- 0.VC(Custom)-DisableThreadLibraryCalls
- [转载]DllMain中不当操作导致死锁问题的分析--DisableThreadLibraryCalls对DllMain中死锁的影响
- DllMain中不当操作导致死锁问题的分析--DisableThreadLibraryCalls对DllMain中死锁的影响
- 简介: DisableThreadLibraryCalls
- CheckForIllegalCrossThreadCalls = false 是干嘛的?
- What is Linux System Calls and Library Functions?
- 1.11.系统调用和库函数(System Calls and Library Functions)
- How to: Make Thread-Safe Calls to Windows Forms Controls
- How to: Make Thread-Safe Calls to Windows Forms Controls
- Control.CheckForIllegalCrossThreadCalls
- 不用Invoke就等用 Control.CheckForIllegalCrossThreadCalls = false;
- Thread Interruption in Boost Thread Library
- Intel open-sourced a multithread library
- How to: Make Thread-Safe Calls to Windows Forms Controls
- 利用CheckForIllegalCrossThreadCalls=false设置跨线程访问
- cute-log - A lightweight, flxiable, high configurable, thread-safe and cute logging library - Google Project Hosting
- Exception in thread "main" java.lang.UnsatisfiedLinkError: no hello in java.library.path