55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
#ifndef ACTIV_BOOST_THREAD_ONCE_HPP
|
|
#define ACTIV_BOOST_THREAD_ONCE_HPP
|
|
|
|
// once.hpp
|
|
//
|
|
// (C) Copyright 2006-7 Anthony Williams
|
|
//
|
|
// Distributed under the Boost Software License, Version 1.0. (See
|
|
// accompanying file LICENSE_1_0.txt or copy at
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#include <ActivBoost/thread/detail/config.hpp>
|
|
|
|
#ifdef ACTIV_BOOST_MSVC
|
|
# pragma warning(push)
|
|
# pragma warning(disable: 4702) // unreachable code
|
|
#endif
|
|
|
|
#include <ActivBoost/thread/detail/platform.hpp>
|
|
#if defined(ACTIV_BOOST_THREAD_PLATFORM_WIN32)
|
|
#include <ActivBoost/thread/win32/once.hpp>
|
|
#elif defined(ACTIV_BOOST_THREAD_PLATFORM_PTHREAD)
|
|
#if defined ACTIV_BOOST_THREAD_ONCE_FAST_EPOCH
|
|
#include <ActivBoost/thread/pthread/once.hpp>
|
|
#elif defined ACTIV_BOOST_THREAD_ONCE_ATOMIC
|
|
#include <ActivBoost/thread/pthread/once_atomic.hpp>
|
|
#else
|
|
#error "Once Not Implemented"
|
|
#endif
|
|
#else
|
|
#error "Boost threads unavailable on this platform"
|
|
#endif
|
|
|
|
#include <ActivBoost/config/abi_prefix.hpp>
|
|
|
|
namespace Boost
|
|
{
|
|
// template<class Callable, class ...Args> void
|
|
// call_once(once_flag& flag, Callable&& func, Args&&... args);
|
|
template<typename Function>
|
|
inline void call_once(Function func,once_flag& flag)
|
|
//inline void call_once(void (*func)(),once_flag& flag)
|
|
{
|
|
call_once(flag,func);
|
|
}
|
|
}
|
|
|
|
#include <ActivBoost/config/abi_suffix.hpp>
|
|
|
|
#ifdef ACTIV_BOOST_MSVC
|
|
# pragma warning(pop)
|
|
#endif
|
|
|
|
#endif
|