os/ossrv/ossrv_pub/boost_apis/boost/thread/once.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (C) 2001-2003
     2 // William E. Kempf
     3 //
     4 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
     5 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     6 
     7 #ifndef BOOST_ONCE_WEK080101_HPP
     8 #define BOOST_ONCE_WEK080101_HPP
     9 
    10 #include <boost/thread/detail/config.hpp>
    11 
    12 #if defined(BOOST_HAS_PTHREADS)
    13 #   include <pthread.h>
    14 #endif
    15 
    16 namespace boost {
    17 
    18 #if defined(BOOST_HAS_PTHREADS)
    19 
    20 typedef pthread_once_t once_flag;
    21 #define BOOST_ONCE_INIT PTHREAD_ONCE_INIT
    22 
    23 #elif (defined(BOOST_HAS_WINTHREADS) || defined(BOOST_HAS_MPTASKS))
    24 
    25 typedef long once_flag;
    26 #define BOOST_ONCE_INIT 0
    27 
    28 #endif
    29 
    30 void BOOST_THREAD_DECL call_once(void (*func)(), once_flag& flag);
    31 
    32 } // namespace boost
    33 
    34 // Change Log:
    35 //   1 Aug 01  WEKEMPF Initial version.
    36 
    37 #endif // BOOST_ONCE_WEK080101_HPP