]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/serialization/src/singleton.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / serialization / src / singleton.cpp
1 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2 // singleton.cpp
3 //
4 // Copyright (c) 201 5 Robert Ramey, Indiana University (garcia@osl.iu.edu)
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9
10 // it marks our code with proper attributes as being exported when
11 // we're compiling it while marking it import when just the headers
12 // is being included.
13 #define BOOST_SERIALIZATION_SOURCE
14 #include <boost/serialization/config.hpp>
15 #include <boost/serialization/singleton.hpp>
16
17 namespace boost {
18 namespace serialization {
19
20 bool & singleton_module::get_lock(){
21 static bool lock = false;
22 return lock;
23 }
24
25 BOOST_SERIALIZATION_DECL void singleton_module::lock(){
26 get_lock() = true;
27 }
28 BOOST_SERIALIZATION_DECL void singleton_module::unlock(){
29 get_lock() = false;
30 }
31 BOOST_SERIALIZATION_DECL bool singleton_module::is_locked() {
32 return get_lock();
33 }
34
35 } // namespace serialization
36 } // namespace boost