Added scope qualifiers to some mutex objects to avoid a name collision

in newer versions of clang.
This commit is contained in:
Davis King 2014-09-27 09:57:28 -04:00
parent ae9701bcca
commit f4f395975e
2 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ void example_using_lambda_functions()
// parallel for loop is implemented using threads, all the usual techniques for
// ensuring thread safety can be used.
int sum = 0;
mutex m;
dlib::mutex m;
vect.assign(10, 2);
parallel_for(num_threads, 0, vect.size(), [&](long i){
// The sleep statements still execute in parallel.
@ -194,7 +194,7 @@ struct function_object_sum
const std::vector<int>& vect;
int& sum;
mutex m;
dlib::mutex m;
void operator() (long i) const
{

View File

@ -23,7 +23,7 @@ using namespace std;
using namespace dlib;
int thread_count = 10;
mutex count_mutex; // This is a mutex we will use to guard the thread_count variable. Note that the mutex doesn't know
dlib::mutex count_mutex; // This is a mutex we will use to guard the thread_count variable. Note that the mutex doesn't know
// anything about the thread_count variable. Only our usage of a mutex determines what it guards.
// In this case we are going to make sure this mutex is always locked before we touch the
// thread_count variable.