// Copyright (C) 2012 Vicente J. Botet Escriba // // 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) // // template class strict_lock; // bool owns_lock(Mutex *) const; #include #include #include #include #ifdef BOOST_THREAD_USES_CHRONO typedef boost::chrono::high_resolution_clock Clock; typedef Clock::time_point time_point; typedef Clock::duration duration; typedef boost::chrono::milliseconds ms; typedef boost::chrono::nanoseconds ns; #endif int main() { boost::mutex m; boost::mutex m2; boost::strict_lock lk(m); BOOST_TEST(lk.owns_lock(&m) == true); BOOST_TEST(!lk.owns_lock(&m2) == true); return boost::report_errors(); }