1 // (C) Copyright Michael Glassford 2004. 2 // Use, modification and distribution are subject to the 3 // Boost Software License, Version 1.0. (See accompanying file 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #if !defined(BOOST_TLS_HOOKS_HPP) 7 #define BOOST_TLS_HOOKS_HPP 8 9 #include <boost/thread/detail/config.hpp> 10 11 #include <boost/config/abi_prefix.hpp> 12 13 #if defined(BOOST_HAS_WINTHREADS) 14 15 namespace boost 16 { 17 BOOST_THREAD_DECL void __cdecl on_process_enter(void); 18 //Function to be called when the exe or dll 19 //that uses Boost.Threads first starts 20 //or is first loaded. 21 //Should be called only before the first call to 22 //on_thread_enter(). 23 //Called automatically by Boost.Threads when 24 //a method for doing so has been discovered. 25 //May be omitted; may be called multiple times. 26 27 BOOST_THREAD_DECL void __cdecl on_process_exit(void); 28 //Function to be called when the exe or dll 29 //that uses Boost.Threads first starts 30 //or is first loaded. 31 //Should be called only after the last call to 32 //on_exit_thread(). 33 //Called automatically by Boost.Threads when 34 //a method for doing so has been discovered. 35 //Must not be omitted; may be called multiple times. 36 37 BOOST_THREAD_DECL void __cdecl on_thread_enter(void); 38 //Function to be called just after a thread starts 39 //in an exe or dll that uses Boost.Threads. 40 //Must be called in the context of the thread 41 //that is starting. 42 //Called automatically by Boost.Threads when 43 //a method for doing so has been discovered. 44 //May be omitted; may be called multiple times. 45 46 BOOST_THREAD_DECL void __cdecl on_thread_exit(void); 47 //Function to be called just be fore a thread ends 48 //in an exe or dll that uses Boost.Threads. 49 //Must be called in the context of the thread 50 //that is ending. 51 //Called automatically by Boost.Threads when 52 //a method for doing so has been discovered. 53 //Must not be omitted; may be called multiple times. 54 55 void tss_cleanup_implemented(); 56 //Dummy function used both to detect whether tss cleanup 57 //cleanup has been implemented and to force 58 //it to be linked into the Boost.Threads library. 59 } 60 61 #endif //defined(BOOST_HAS_WINTHREADS) 62 63 #include <boost/config/abi_suffix.hpp> 64 65 #endif //!defined(BOOST_TLS_HOOKS_HPP) 66