MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / internal_join

Method internal_join

include/dmlc/thread_group.h:254–271  ·  view source on GitHub ↗

! * \brief Internal join function * \param auto_remove_ok Whether to allow join on an auto-remove thread */

Source from the content-addressed store, hash-verified

252 * \param auto_remove_ok Whether to allow join on an auto-remove thread
253 */
254 void internal_join(bool auto_remove_ok) {
255 ReadLock guard(thread_mutex_);
256 // should be careful calling (or any function externally) this when in
257 // auto-remove mode
258 if (thread_.load() && thread_.load()->get_id() != std::thread::id()) {
259 std::thread::id someId;
260 if (!auto_remove_ok) {
261 CHECK_EQ(auto_remove_, false);
262 }
263 CHECK_NOTNULL(thread_.load());
264 if (thread_.load()->joinable()) {
265 thread_.load()->join();
266 } else {
267 LOG(WARNING) << "Thread " << name_ << " ( "
268 << thread_.load()->get_id() << " ) not joinable";
269 }
270 }
271 }
272
273 /*!
274 * \brief Thread bootstrapping and teardown wrapper

Callers

nothing calls this directly

Calls 3

get_idMethod · 0.80
joinableMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected