MCPcopy Create free account
hub / github.com/acl-dev/acl / wait_for_running

Method wait_for_running

lib_acl_cpp/src/stdlib/thread.cpp:50–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50void thread::wait_for_running()
51{
52 if (lock_->cas(0, 1) == 0) {
53 if (thread_id_ == 0) {
54 (void) sync_->pop();
55 }
56 } else if (thread_id_ == 0) {
57 sleep(1);
58 }
59}
60
61void* thread::thread_run(void* arg)
62{

Callers 1

thread_idMethod · 0.80

Calls 3

casMethod · 0.80
sleepFunction · 0.50
popMethod · 0.45

Tested by

no test coverage detected