summaryrefslogtreecommitdiffstats
path: root/src/boost/libs/smart_ptr/test/spinlock_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boost/libs/smart_ptr/test/spinlock_test.cpp')
-rw-r--r--src/boost/libs/smart_ptr/test/spinlock_test.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/boost/libs/smart_ptr/test/spinlock_test.cpp b/src/boost/libs/smart_ptr/test/spinlock_test.cpp
new file mode 100644
index 00000000..d2c66c00
--- /dev/null
+++ b/src/boost/libs/smart_ptr/test/spinlock_test.cpp
@@ -0,0 +1,31 @@
+//
+// spinlock_test.cpp
+//
+// Copyright 2008 Peter Dimov
+//
+// Distributed under 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)
+//
+
+#include <boost/smart_ptr/detail/spinlock.hpp>
+
+// Sanity check only
+
+static boost::detail::spinlock sp = BOOST_DETAIL_SPINLOCK_INIT;
+static boost::detail::spinlock sp2 = BOOST_DETAIL_SPINLOCK_INIT;
+
+int main()
+{
+ sp.lock();
+ sp2.lock();
+ sp.unlock();
+ sp2.unlock();
+
+ {
+ boost::detail::spinlock::scoped_lock lock( sp );
+ boost::detail::spinlock::scoped_lock lock2( sp2 );
+ }
+
+ return 0;
+}