1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: no-threads
10
11// <mutex>
12
13// class recursive_mutex;
14
15// recursive_mutex();
16
17#include <mutex>
18#include <cassert>
19#include <type_traits>
20
21int main(int, char**) {
22 // The mutex is unlocked after default construction
23 {
24 std::recursive_mutex m;
25 assert(m.try_lock());
26 m.unlock();
27 }
28
29 return 0;
30}
31

source code of libcxx/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.recursive/ctor.default.pass.cpp