コード例 #1
0
        extern "C" BOOL WINAPI DllMain(HINSTANCE /*hInstance*/, DWORD dwReason, LPVOID /*lpReserved*/)
    #endif
    {
        switch(dwReason)
        {
            case DLL_PROCESS_ATTACH:
            {
                on_process_enter();
                on_thread_enter();
                break;
            }

            case DLL_THREAD_ATTACH:
            {
                on_thread_enter();
                break;
            }

            case DLL_THREAD_DETACH:
            {
                on_thread_exit();
                break;
            }

            case DLL_PROCESS_DETACH:
            {
                on_thread_exit();
                on_process_exit();
                break;
            }
        }

        return TRUE;
    }
コード例 #2
0
ファイル: thread.cpp プロジェクト: Albermg7/boost
        static OSStatus thread_proxy(void* param)
#endif
    {
        try
        {
            thread_param* p = static_cast<thread_param*>(param);
            boost::function0<void> threadfunc = p->m_threadfunc;
            p->started();
            threadfunc();
#if defined(BOOST_HAS_WINTHREADS)
            on_thread_exit();
#endif
        }
        catch (...)
        {
#if defined(BOOST_HAS_WINTHREADS)
            on_thread_exit();
#endif
        }
#if defined(BOOST_HAS_MPTASKS)
        ::boost::detail::thread_cleanup();
#endif
        return 0;
    }