32 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 std::thread t = support::make_test_thread([&](){25 l.arrive_and_wait();26 });27 l.arrive_and_wait();28 t.join();29 30 return 0;31}32