2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-21 17:32:18 +00:00
Files
thread/test/sync/mutual_exclusion/mutex/try_lock_compile_pass.cpp

20 lines
397 B
C++

// Copyright (C) 2017 Tom Hughes
//
// 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)
// <boost/thread/mutex.hpp>
// class mutex;
#include <boost/thread/mutex.hpp>
#include <boost/detail/lightweight_test.hpp>
void pass()
{
boost::mutex m0;
if (m0.try_lock()) {
m0.unlock();
}
}