thread/test/test_8455.cpp
Vicente J. Botet Escriba f3a66f76e0 Thread: merge from trunk for 1.56.
[SVN r86770]
2013-11-19 21:58:34 +00:00

24 lines
580 B
C++

// Copyright (C) 2013 Vicente Botet
//
// 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/thread/mutex.hpp>
boost::mutex mut;
void boostMutexImp1()
{
boost::mutex::scoped_lock lock(mut);
mut.unlock(); // A: with this X blocks
//lock.unlock(); // No influence if used also if before A
}
void boostMutexImp2()
{
boost::mutex::scoped_lock lock(mut); // X: blocks with A
}
int main()
{
boostMutexImp1();
boostMutexImp2();
return 0;
}