33 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9// UNSUPPORTED: no-threads10// UNSUPPORTED: c++03, c++11, c++14, c++1711 12// <latch>13 14#include <latch>15#include <thread>16 17#include "make_test_thread.h"18#include "test_macros.h"19 20int main(int, char**)21{22 std::latch l(2);23 24 l.count_down();25 std::thread t = support::make_test_thread([&](){26 l.count_down();27 });28 l.wait();29 t.join();30 31 return 0;32}33