tss_hooks.hpp 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #if !defined(BOOST_TLS_HOOKS_HPP)
  6. #define BOOST_TLS_HOOKS_HPP
  7. #include <boost/thread/detail/config.hpp>
  8. #include <boost/config/abi_prefix.hpp>
  9. #if defined(BOOST_THREAD_WIN32)
  10. namespace boost
  11. {
  12. BOOST_THREAD_DECL void __cdecl on_process_enter(void);
  13. //Function to be called when the exe or dll
  14. //that uses Boost.Threads first starts
  15. //or is first loaded.
  16. //Should be called only before the first call to
  17. //on_thread_enter().
  18. //Called automatically by Boost.Threads when
  19. //a method for doing so has been discovered.
  20. //May be omitted; may be called multiple times.
  21. BOOST_THREAD_DECL void __cdecl on_process_exit(void);
  22. //Function to be called when the exe or dll
  23. //that uses Boost.Threads first starts
  24. //or is first loaded.
  25. //Should be called only after the last call to
  26. //on_exit_thread().
  27. //Called automatically by Boost.Threads when
  28. //a method for doing so has been discovered.
  29. //Must not be omitted; may be called multiple times.
  30. BOOST_THREAD_DECL void __cdecl on_thread_enter(void);
  31. //Function to be called just after a thread starts
  32. //in an exe or dll that uses Boost.Threads.
  33. //Must be called in the context of the thread
  34. //that is starting.
  35. //Called automatically by Boost.Threads when
  36. //a method for doing so has been discovered.
  37. //May be omitted; may be called multiple times.
  38. BOOST_THREAD_DECL void __cdecl on_thread_exit(void);
  39. //Function to be called just be fore a thread ends
  40. //in an exe or dll that uses Boost.Threads.
  41. //Must be called in the context of the thread
  42. //that is ending.
  43. //Called automatically by Boost.Threads when
  44. //a method for doing so has been discovered.
  45. //Must not be omitted; may be called multiple times.
  46. void tss_cleanup_implemented();
  47. //Dummy function used both to detect whether tss cleanup
  48. //cleanup has been implemented and to force
  49. //it to be linked into the Boost.Threads library.
  50. }
  51. #endif //defined(BOOST_THREAD_WIN32)
  52. #include <boost/config/abi_suffix.hpp>
  53. #endif //!defined(BOOST_TLS_HOOKS_HPP)