MCPcopy Create free account
hub / github.com/apache/impala / tid

Method tid

be/src/kudu/util/thread.h:166–172  ·  view source on GitHub ↗

A thread's OS-specific TID is assigned after it start running. However, in order to improve the performance of thread creation, the parent thread does not wait for the child thread to start running before Create() returns. Therefore, when the parent thread finishes Create(), the child thread may not have a OS-specific TID (because it has not actually started execution). In order to get the correc

Source from the content-addressed store, hash-verified

164 // In order to get the correct tid, this method spins until the child
165 // thread gets the TID.
166 int64_t tid() const {
167 int64_t t = base::subtle::Acquire_Load(&tid_);
168 if (t != PARENT_WAITING_TID) {
169 return tid_;
170 }
171 return WaitForTid();
172 }
173
174 // Returns the thread's pthread ID.
175 pthread_t pthread_id() const { return thread_; }

Callers 5

JoinMethod · 0.45
StartThreadMethod · 0.45
TEST_FFunction · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45

Calls 1

Acquire_LoadFunction · 0.50

Tested by 3

TEST_FFunction · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36