1 #ifndef BOOST_THREAD_ONCE_HPP
2 #define BOOST_THREAD_ONCE_HPP
6 // (C) Copyright 2006-7 Anthony Williams
8 // Distributed under the Boost Software License, Version 1.0. (See
9 // accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
12 #include <boost/thread/detail/config.hpp>
15 # pragma warning(push)
16 # pragma warning(disable: 4702) // unreachable code
19 #include <boost/thread/detail/platform.hpp>
20 #if defined(BOOST_THREAD_PLATFORM_WIN32)
21 #include <boost/thread/win32/once.hpp>
22 #elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
23 #if defined BOOST_THREAD_ONCE_FAST_EPOCH
24 #include <boost/thread/pthread/once.hpp>
25 #elif defined BOOST_THREAD_ONCE_ATOMIC
26 #include <boost/thread/pthread/once_atomic.hpp>
28 #error "Once Not Implemented"
31 #error "Boost threads unavailable on this platform"
34 #include <boost/config/abi_prefix.hpp>
38 // template<class Callable, class ...Args> void
39 // call_once(once_flag& flag, Callable&& func, Args&&... args);
40 template<typename Function>
41 inline void call_once(Function func,once_flag& flag)
42 //inline void call_once(void (*func)(),once_flag& flag)
48 #include <boost/config/abi_suffix.hpp>