1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
10 // UNSUPPORTED: c++03, c++11
12 // XFAIL: availability-synchronization_library-missing
19 #include <type_traits>
21 #include "make_test_thread.h"
22 #include "test_macros.h"
24 static_assert(std::is_same
<std::binary_semaphore
, std::counting_semaphore
<1>>::value
, "");
28 std::binary_semaphore
s(1);
31 for(int i
= 0; i
< 1024; ++i
) {
33 std::this_thread::sleep_for(std::chrono::microseconds(1));
38 std::thread t
= support::make_test_thread(l
);