source: NonGTP/Boost/boost/thread/once.hpp @ 857

Revision 857, 1.2 KB checked in by igarcia, 18 years ago (diff)
Line 
1// Copyright (C) 2001-2003
2// William E. Kempf
3//
4// Permission to use, copy, modify, distribute and sell this software
5// and its documentation for any purpose is hereby granted without fee,
6// provided that the above copyright notice appear in all copies and
7// that both that copyright notice and this permission notice appear
8// in supporting documentation.  William E. Kempf makes no representations
9// about the suitability of this software for any purpose.
10// It is provided "as is" without express or implied warranty.
11
12#ifndef BOOST_ONCE_WEK080101_HPP
13#define BOOST_ONCE_WEK080101_HPP
14
15#include <boost/thread/detail/config.hpp>
16
17#if defined(BOOST_HAS_PTHREADS)
18#   include <pthread.h>
19#endif
20
21namespace boost {
22
23#if defined(BOOST_HAS_PTHREADS)
24
25typedef pthread_once_t once_flag;
26#define BOOST_ONCE_INIT PTHREAD_ONCE_INIT
27
28#elif (defined(BOOST_HAS_WINTHREADS) || defined(BOOST_HAS_MPTASKS))
29
30typedef long once_flag;
31#define BOOST_ONCE_INIT 0
32
33#endif
34
35void BOOST_THREAD_DECL call_once(void (*func)(), once_flag& flag);
36
37} // namespace boost
38
39// Change Log:
40//   1 Aug 01  WEKEMPF Initial version.
41
42#endif // BOOST_ONCE_WEK080101_HPP
Note: See TracBrowser for help on using the repository browser.