Re: Compiler gives wrong output

2015-06-09 Thread U.Mutlu
Richard Kettlewell wrote on 06/09/2015 10:16 AM: "U.Mutlu" writes: Hi, on this page: http://en.cppreference.com/w/cpp/thread/recursive_mutex/try_lock they give the following C++11 example: #include #include int main() { std::mutex test; if (test.try_lock()==true) { std::c

Re: Compiler gives wrong output

2015-06-09 Thread Richard Kettlewell
"U.Mutlu" writes: > Hi, > on this page: > http://en.cppreference.com/w/cpp/thread/recursive_mutex/try_lock > they give the following C++11 example: > > #include > #include > > int main() > { > std::mutex test; > if (test.try_lock()==true) { > std::cout << "lock acquired" << std::

Compiler gives wrong output

2015-06-08 Thread U.Mutlu
Hi, on this page: http://en.cppreference.com/w/cpp/thread/recursive_mutex/try_lock they give the following C++11 example: #include #include int main() { std::mutex test; if (test.try_lock()==true) { std::cout << "lock acquired" << std::endl; test.unlock();//now unlo