MCPcopy Create free account
hub / github.com/ROCm/clr / main

Method main

rocclr/thread/thread.cpp:63–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void* Thread::main() {
64#ifdef DEBUG
65 Os::setCurrentThreadName(name().c_str());
66#endif // DEBUG
67 Os::currentStackInfo(&stackBase_, &stackSize_);
68 setCurrent();
69
70 // Notify the parent thread that we are up and running.
71 {
72 ScopedLock sl(selfSuspendLock_);
73 // Notify parent thread that the state is update as INITIALIZED
74 setState(INITIALIZED);
75 selfSuspendLock_->notify();
76 }
77
78 // Now we need to wait for Thread::start() to report back.
79 {
80 ScopedLock sl(selfSuspendLock_);
81 // wait for start() to update state as RUNNABLE
82 while (state() != Thread::RUNNABLE) {
83 selfSuspendLock_->wait();
84 }
85 }
86
87
88 if (state() == RUNNABLE) {
89 run(data_);
90 }
91
92 setState(FINISHED);
93 return NULL;
94}
95
96bool Thread::start(void* data) {
97 if (state() != INITIALIZED) {

Callers 2

entryMethod · 0.80
entryMethod · 0.80

Calls 4

nameFunction · 0.85
runFunction · 0.85
notifyMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected