CMS 3D CMS Logo

RunProcessingStatus.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Framework
4 // Class : RunProcessingStatus
5 //
6 // Original Author: W. David Dagenhart
7 // Created: 7 October 2021
8 
9 #include "RunProcessingStatus.h"
11 
12 namespace edm {
13  RunProcessingStatus::RunProcessingStatus(unsigned int iNStreams, WaitingTaskHolder const& holder)
14  : holderOfTaskInProcessRuns_(holder),
15  nStreamsStillProcessingBeginRun_(iNStreams),
16  nStreamsStillProcessingRun_(iNStreams) {}
17 
19  endIOVWaitingTasks_.doneWaiting(std::exception_ptr{});
20  for (auto& iter : eventSetupImpls_) {
21  iter.reset();
22  }
23  }
24 
26  endIOVWaitingTasksEndRun_.doneWaiting(std::exception_ptr{});
27  for (auto& iter : eventSetupImplsEndRun_) {
28  iter.reset();
29  }
30  }
31 
33  constexpr char kUnset = 0;
34  constexpr char kSetting = 1;
35  constexpr char kSet = 2;
36 
37  if (endTimeSetStatus_ != kSet) {
38  //not already set
39  char expected = kUnset;
40  if (endTimeSetStatus_.compare_exchange_strong(expected, kSetting)) {
41  runPrincipal_->setEndTime(endTime_);
42  endTimeSetStatus_.store(kSet);
43  } else {
44  //wait until time is set
45  while (endTimeSetStatus_.load() != kSet) {
46  }
47  }
48  }
49  }
50 } // namespace edm
WaitingTaskList endIOVWaitingTasks_
RunProcessingStatus(unsigned int iNStreams, WaitingTaskHolder const &holder)
WaitingTaskList endIOVWaitingTasksEndRun_
const char * kSet
void doneWaiting(std::exception_ptr iPtr)
Signals that the resource is now available and tasks should be spawned.
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImpls_
std::atomic< char > endTimeSetStatus_
std::vector< std::shared_ptr< const EventSetupImpl > > eventSetupImplsEndRun_
constexpr unsigned int kUnset
HLT enums.
std::shared_ptr< RunPrincipal > runPrincipal_