Skip to content

Commit

Permalink
Merge CMSSW_10_5_X into CMSSW_10_5_DEVEL_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Jan 31, 2019
2 parents 8dcbfef + 2f750d8 commit cca6708
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
11 changes: 8 additions & 3 deletions FWCore/Concurrency/interface/WaitingTaskHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ namespace edm {
if(iExcept) {
m_task->dependentTaskFailed(iExcept);
}
if(0==m_task->decrement_ref_count()){
tbb::task::spawn(*m_task);
}
//spawn can run the task before we finish
// doneWaiting and some other thread might
// try to reuse this object. Resetting
// before spawn avoids problems
auto task = m_task;
m_task = nullptr;
if(0==task->decrement_ref_count()){
tbb::task::spawn(*task);
}
}

private:
Expand Down
11 changes: 8 additions & 3 deletions FWCore/Concurrency/src/WaitingTaskWithArenaHolder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,17 @@ namespace edm {
if (iExcept) {
m_task->dependentTaskFailed(iExcept);
}
if (0 == m_task->decrement_ref_count()) {
//enqueue can run the task before we finish
// doneWaiting and some other thread might
// try to reuse this object. Resetting
// before enqueue avoids problems
auto task = m_task;
m_task = nullptr;
if (0 == task->decrement_ref_count()) {
// The enqueue call will cause a worker thread to be created in
// the arena if there is not one already.
m_arena->enqueue( [m_task = m_task](){ tbb::task::spawn(*m_task); });
m_arena->enqueue( [task = task](){ tbb::task::spawn(*task); });
}
m_task = nullptr;
}

// This next function is useful if you know from the context that
Expand Down
2 changes: 1 addition & 1 deletion Geometry/CSCGeometryBuilder/plugins/CSCGeometryESModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void CSCGeometryESModule::initCSCGeometry_( const MuonGeometryRecord& record, st
if ( useDDD_ ) {

host->ifRecordChanges<MuonNumberingRecord>(record,
[this, &host, &record](auto const& rec) {
[&host, &record](auto const& rec) {
host->clear();
edm::ESTransientHandle<DDCompactView> cpv;
edm::ESHandle<MuonDDDConstants> mdc;
Expand Down

0 comments on commit cca6708

Please sign in to comment.