forked from boostorg/smart_ptr
lw_mutex_test added.
[SVN r27931]
This commit is contained in:
@ -27,6 +27,7 @@ DEPENDS all : smart_ptr ;
|
|||||||
[ run intrusive_ptr_test.cpp ]
|
[ run intrusive_ptr_test.cpp ]
|
||||||
[ run intrusive_ptr_test.cpp ]
|
[ run intrusive_ptr_test.cpp ]
|
||||||
[ run atomic_count_test.cpp ]
|
[ run atomic_count_test.cpp ]
|
||||||
|
[ run lw_mutex_test.cpp ]
|
||||||
[ compile-fail shared_ptr_assign_fail.cpp ]
|
[ compile-fail shared_ptr_assign_fail.cpp ]
|
||||||
[ compile-fail shared_ptr_delete_fail.cpp ]
|
[ compile-fail shared_ptr_delete_fail.cpp ]
|
||||||
;
|
;
|
||||||
|
@ -21,6 +21,7 @@ import testing ;
|
|||||||
[ run get_deleter_test.cpp ]
|
[ run get_deleter_test.cpp ]
|
||||||
[ run intrusive_ptr_test.cpp ]
|
[ run intrusive_ptr_test.cpp ]
|
||||||
[ run atomic_count_test.cpp ]
|
[ run atomic_count_test.cpp ]
|
||||||
|
[ run lw_mutex_test.cpp ]
|
||||||
[ compile-fail shared_ptr_assign_fail.cpp ]
|
[ compile-fail shared_ptr_assign_fail.cpp ]
|
||||||
[ compile-fail shared_ptr_delete_fail.cpp ]
|
[ compile-fail shared_ptr_delete_fail.cpp ]
|
||||||
;
|
;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// astomic_count_test.cpp
|
// atomic_count_test.cpp
|
||||||
//
|
//
|
||||||
// Copyright 2005 Peter Dimov
|
// Copyright 2005 Peter Dimov
|
||||||
//
|
//
|
||||||
|
28
test/lw_mutex_test.cpp
Normal file
28
test/lw_mutex_test.cpp
Normal file
@ -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 <boost/detail/lightweight_mutex.hpp>
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
Reference in New Issue
Block a user