equal
deleted
inserted
replaced
|
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 |