projects
/
platform
/
upstream
/
boost.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.57.0
[platform/upstream/boost.git]
/
libs
/
thread
/
example
/
recursive_mutex.cpp
diff --git
a/libs/thread/example/recursive_mutex.cpp
b/libs/thread/example/recursive_mutex.cpp
index
c519954
..
a589483
100644
(file)
--- a/
libs/thread/example/recursive_mutex.cpp
+++ b/
libs/thread/example/recursive_mutex.cpp
@@
-1,7
+1,7
@@
// Copyright (C) 2001-2003
// William E. Kempf
//
// Copyright (C) 2001-2003
// William E. Kempf
//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
+// 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/recursive_mutex.hpp>
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/thread/recursive_mutex.hpp>
@@
-14,12
+14,12
@@
public:
counter() : count(0) { }
int add(int val) {
counter() : count(0) { }
int add(int val) {
- boost::
recursive_mutex::scoped_lock
scoped_lock(mutex);
+ boost::
unique_lock<boost::recursive_mutex>
scoped_lock(mutex);
count += val;
return count;
}
int increment() {
count += val;
return count;
}
int increment() {
- boost::
recursive_mutex::scoped_lock
scoped_lock(mutex);
+ boost::
unique_lock<boost::recursive_mutex>
scoped_lock(mutex);
return add(1);
}
return add(1);
}