lock_guard_compile_fail.cpp 533 B

12345678910111213141516171819202122
  1. // Copyright (C) 2018 Tom Hughes
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // <boost/thread/lock_guard.hpp>
  6. // template <class Mutex> class lock_guard;
  7. // lock_guard(Mutex& m_)
  8. #include <boost/thread/lock_guard.hpp>
  9. #include <boost/thread/mutex.hpp>
  10. #include <boost/detail/lightweight_test.hpp>
  11. boost::mutex m;
  12. void fail()
  13. {
  14. boost::lock_guard<boost::mutex> lk0(m);
  15. boost::lock_guard<boost::mutex> lk1(m);
  16. }