From 13657c8bdaa164d4e704477cfc321a3ed637f0f5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sat, 2 Apr 2005 12:51:17 +0000 Subject: [PATCH] lw_mutex_test added. [SVN r27931] --- test/Jamfile | 1 + test/Jamfile.v2 | 1 + test/atomic_count_test.cpp | 2 +- test/lw_mutex_test.cpp | 28 ++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 test/lw_mutex_test.cpp diff --git a/test/Jamfile b/test/Jamfile index 6e23b25..d4cb858 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -27,6 +27,7 @@ DEPENDS all : smart_ptr ; [ run intrusive_ptr_test.cpp ] [ run intrusive_ptr_test.cpp ] [ run atomic_count_test.cpp ] + [ run lw_mutex_test.cpp ] [ compile-fail shared_ptr_assign_fail.cpp ] [ compile-fail shared_ptr_delete_fail.cpp ] ; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 128853e..16c988e 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -21,6 +21,7 @@ import testing ; [ run get_deleter_test.cpp ] [ run intrusive_ptr_test.cpp ] [ run atomic_count_test.cpp ] + [ run lw_mutex_test.cpp ] [ compile-fail shared_ptr_assign_fail.cpp ] [ compile-fail shared_ptr_delete_fail.cpp ] ; diff --git a/test/atomic_count_test.cpp b/test/atomic_count_test.cpp index 07e2e99..ecc24c0 100644 --- a/test/atomic_count_test.cpp +++ b/test/atomic_count_test.cpp @@ -1,5 +1,5 @@ // -// astomic_count_test.cpp +// atomic_count_test.cpp // // Copyright 2005 Peter Dimov // diff --git a/test/lw_mutex_test.cpp b/test/lw_mutex_test.cpp new file mode 100644 index 0000000..a47ac1e --- /dev/null +++ b/test/lw_mutex_test.cpp @@ -0,0 +1,28 @@ +// +// lw_mutex_test.cpp +// +// Copyright 2005 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 + +// Sanity check only + +boost::detail::lightweight_mutex m1; + +int main() +{ + boost::detail::lightweight_mutex::scoped_lock lock1( m1 ); + + boost::detail::lightweight_mutex m2; + boost::detail::lightweight_mutex m3; + + boost::detail::lightweight_mutex::scoped_lock lock2( m2 ); + boost::detail::lightweight_mutex::scoped_lock lock3( m3 ); + + return 0; +}