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
15 // bool joinable() const;
22 #include "make_test_thread.h"
23 #include "test_macros.h"
32 G() : alive_(1) {++n_alive
;}
33 G(const G
& g
) : alive_(g
.alive_
) {++n_alive
;}
34 ~G() {alive_
= 0; --n_alive
;}
45 bool G::op_run
= false;
51 std::thread t0
= support::make_test_thread(g
);
52 assert(t0
.joinable());
54 assert(!t0
.joinable());