LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
ScheduleContext_service.cc
Go to the documentation of this file.
2 
5 #include "cetlib/ProvideFilePathMacro.h"
6 
7 #include "tbb/task.h"
8 
11 {
12  if (!in_context_.load()) {
13  return ScheduleID{};
14  } // Not in schedule-running context.
15  tbb::task* ct = &tbb::task::self();
16  detail::ScheduleTask* st{nullptr};
17  while (ct != nullptr &&
18  (st = dynamic_cast<detail::ScheduleTask*>(ct)) == nullptr) {
19  ct = ct->parent();
20  }
21  return (st ? st->scheduleID() : ScheduleID());
22 }
23 
24 // ===============================
25 CET_PROVIDE_FILE_PATH()
26 // ===============================
ScheduleID currentScheduleID() const
std::atomic< flag_type > in_context_