Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:46:59

0001 // -*- C++ -*-
0002 //
0003 // Package:     FWCore/Framework
0004 // Class  :     LuminosityBlockProcessingStatus
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Thu, 11 Jan 2018 16:41:46 GMT
0011 //
0012 
0013 #include "LuminosityBlockProcessingStatus.h"
0014 #include "FWCore/Framework/interface/LuminosityBlockPrincipal.h"
0015 
0016 namespace edm {
0017   void LuminosityBlockProcessingStatus::resetResources() {
0018     endIOVWaitingTasks_.doneWaiting(std::exception_ptr{});
0019     for (auto& iter : eventSetupImpls_) {
0020       iter.reset();
0021     }
0022     resumeGlobalLumiQueue();
0023   }
0024 
0025   void LuminosityBlockProcessingStatus::setGlobalEndRunHolder(WaitingTaskHolder holder) {
0026     globalEndRunHolder_ = std::move(holder);
0027   }
0028 
0029   void LuminosityBlockProcessingStatus::setEndTime() {
0030     constexpr char kUnset = 0;
0031     constexpr char kSetting = 1;
0032     constexpr char kSet = 2;
0033 
0034     if (endTimeSetStatus_ != kSet) {
0035       //not already set
0036       char expected = kUnset;
0037       if (endTimeSetStatus_.compare_exchange_strong(expected, kSetting)) {
0038         lumiPrincipal_->setEndTime(endTime_);
0039         endTimeSetStatus_.store(kSet);
0040       } else {
0041         //wait until time is set
0042         while (endTimeSetStatus_.load() != kSet) {
0043         }
0044       }
0045     }
0046   }
0047 }  // namespace edm