blob: bbc4e5673995a0f96d487412181efefab1a5b7fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// 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;
}
|