| 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 timed_mutex; |
| 14 | |
| 15 | // timed_mutex(); |
| 16 | |
| 17 | #include <mutex> |
| 18 | #include <cassert> |
| 19 | |
| 20 | int main(int, char**) { |
| 21 | // The mutex is unlocked after default construction |
| 22 | { |
| 23 | std::timed_mutex m; |
| 24 | assert(m.try_lock()); |
| 25 | m.unlock(); |
| 26 | } |
| 27 | |
| 28 | return 0; |
| 29 | } |
| 30 | |