From e0737c56c1e384e05064a0c6e1ac46979371041b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 19 Dec 2018 22:58:32 +0100 Subject: New upstream version 2.0.0+repack --- boost/libs/serialization/src/singleton.cpp | 36 ++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 boost/libs/serialization/src/singleton.cpp (limited to 'boost/libs/serialization/src/singleton.cpp') diff --git a/boost/libs/serialization/src/singleton.cpp b/boost/libs/serialization/src/singleton.cpp new file mode 100644 index 00000000..b8078c1b --- /dev/null +++ b/boost/libs/serialization/src/singleton.cpp @@ -0,0 +1,36 @@ +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// singleton.cpp +// +// Copyright (c) 201 5 Robert Ramey, Indiana University (garcia@osl.iu.edu) +// Use, modification and distribution is subject to 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) +// + +// it marks our code with proper attributes as being exported when +// we're compiling it while marking it import when just the headers +// is being included. +#define BOOST_SERIALIZATION_SOURCE +#include +#include + +namespace boost { +namespace serialization { + +bool & singleton_module::get_lock(){ + static bool lock = false; + return lock; +} + +BOOST_SERIALIZATION_DECL void singleton_module::lock(){ + get_lock() = true; +} +BOOST_SERIALIZATION_DECL void singleton_module::unlock(){ + get_lock() = false; +} +BOOST_SERIALIZATION_DECL bool singleton_module::is_locked() { + return get_lock(); +} + +} // namespace serialization +} // namespace boost -- cgit v1.2.3