#include #include #include using namespace pls::internal::base; using namespace std; static bool visited; TEST_CASE( "thread creation and joining", "[internal/base/thread.h]") { visited = false; auto t1 = thread::start([]() { visited = true; }, 0); t1.join(); REQUIRE(visited); } TEST_CASE( "thread state", "[internal/base/thread.h]") { auto t1 = thread::start([]() { REQUIRE(thread::get_current()->local_object_ == 1); }, 1); auto t2 = thread::start([]() { REQUIRE(thread::get_current()->local_object_ == "Hello"); }, "Hello"); t1.join(); t2.join(); }