sl@0: // Copyright (C) 2001-2003 sl@0: // William E. Kempf sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying sl@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: #ifndef BOOST_ONCE_WEK080101_HPP sl@0: #define BOOST_ONCE_WEK080101_HPP sl@0: sl@0: #include sl@0: sl@0: #if defined(BOOST_HAS_PTHREADS) sl@0: # include sl@0: #endif sl@0: sl@0: namespace boost { sl@0: sl@0: #if defined(BOOST_HAS_PTHREADS) sl@0: sl@0: typedef pthread_once_t once_flag; sl@0: #define BOOST_ONCE_INIT PTHREAD_ONCE_INIT sl@0: sl@0: #elif (defined(BOOST_HAS_WINTHREADS) || defined(BOOST_HAS_MPTASKS)) sl@0: sl@0: typedef long once_flag; sl@0: #define BOOST_ONCE_INIT 0 sl@0: sl@0: #endif sl@0: sl@0: void BOOST_THREAD_DECL call_once(void (*func)(), once_flag& flag); sl@0: sl@0: } // namespace boost sl@0: sl@0: // Change Log: sl@0: // 1 Aug 01 WEKEMPF Initial version. sl@0: sl@0: #endif // BOOST_ONCE_WEK080101_HPP