Chris@16: // (C) Copyright Michael Glassford 2004. Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #if !defined(BOOST_TLS_HOOKS_HPP) Chris@16: #define BOOST_TLS_HOOKS_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: #if defined(BOOST_HAS_WINTHREADS) Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: BOOST_THREAD_DECL void __cdecl on_process_enter(void); Chris@16: //Function to be called when the exe or dll Chris@16: //that uses Boost.Threads first starts Chris@16: //or is first loaded. Chris@16: //Should be called only before the first call to Chris@16: //on_thread_enter(). Chris@16: //Called automatically by Boost.Threads when Chris@16: //a method for doing so has been discovered. Chris@16: //May be omitted; may be called multiple times. Chris@16: Chris@16: BOOST_THREAD_DECL void __cdecl on_process_exit(void); Chris@16: //Function to be called when the exe or dll Chris@16: //that uses Boost.Threads first starts Chris@16: //or is first loaded. Chris@16: //Should be called only after the last call to Chris@16: //on_exit_thread(). Chris@16: //Called automatically by Boost.Threads when Chris@16: //a method for doing so has been discovered. Chris@16: //Must not be omitted; may be called multiple times. Chris@16: Chris@16: BOOST_THREAD_DECL void __cdecl on_thread_enter(void); Chris@16: //Function to be called just after a thread starts Chris@16: //in an exe or dll that uses Boost.Threads. Chris@16: //Must be called in the context of the thread Chris@16: //that is starting. Chris@16: //Called automatically by Boost.Threads when Chris@16: //a method for doing so has been discovered. Chris@16: //May be omitted; may be called multiple times. Chris@16: Chris@16: BOOST_THREAD_DECL void __cdecl on_thread_exit(void); Chris@16: //Function to be called just be fore a thread ends Chris@16: //in an exe or dll that uses Boost.Threads. Chris@16: //Must be called in the context of the thread Chris@16: //that is ending. Chris@16: //Called automatically by Boost.Threads when Chris@16: //a method for doing so has been discovered. Chris@16: //Must not be omitted; may be called multiple times. Chris@16: Chris@16: void tss_cleanup_implemented(); Chris@16: //Dummy function used both to detect whether tss cleanup Chris@16: //cleanup has been implemented and to force Chris@16: //it to be linked into the Boost.Threads library. Chris@16: } Chris@16: Chris@16: #endif //defined(BOOST_HAS_WINTHREADS) Chris@16: Chris@16: #include Chris@16: Chris@16: #endif //!defined(BOOST_TLS_HOOKS_HPP)