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

Method start

be/src/rpc/thrift-thread.cc:33–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace atc = apache::thrift::concurrency;
32
33void ThriftThread::start() {
34 Promise<atc::Thread::id_t> promise;
35 // As noted in https://en.cppreference.com/w/cpp/utility/functional/bind, std::bind
36 // makes a copy of its arguments, notably runnable() which is a shared_ptr. That ensures
37 // it will live as long as the thread despite passing to RunRunnable by reference.
38 Status status = impala::Thread::Create(group_, name_,
39 bind(&ThriftThread::RunRunnable, this, runnable(), &promise), &impala_thread_);
40
41 // Thread creation failed. Thrift expects an exception in this case. See
42 // the implementation of atc::PosixThreadFactory.cpp or atc::BoostThreadFactory.cpp.
43 if (!status.ok()) {
44 throw atc::SystemResourceException(
45 Substitute("Thread::Create() failed: $0", status.GetDetail()));
46 }
47
48 // Blocks until the thread id has been set
49 tid_ = promise.Get();
50}
51
52atc::Thread::id_t ThriftThread::getId() {
53 return tid_;

Callers

nothing calls this directly

Calls 6

CreateClass · 0.85
bindFunction · 0.85
SubstituteFunction · 0.85
GetDetailMethod · 0.80
okMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected