CMS 3D CMS Logo

ThreadSafeOutputFileStream.cc
Go to the documentation of this file.
2 
3 #include <sstream>
4 
5 namespace edm {
6 
8 
11  while (waitingMessages_.try_pop(tmp)) {
12  file_ << tmp;
13  }
14  file_.close();
15  }
16 
19  bool expected{false};
20  if (msgBeingLogged_.compare_exchange_strong(expected, true)) {
22  while (waitingMessages_.try_pop(tmp)) {
23  file_ << tmp;
24  }
25  msgBeingLogged_.store(false);
26  }
27  }
28 } // namespace edm
edm::ThreadSafeOutputFileStream::~ThreadSafeOutputFileStream
~ThreadSafeOutputFileStream()
Definition: ThreadSafeOutputFileStream.cc:9
edm
HLT enums.
Definition: AlignableModifier.h:19
mps_check.msg
tuple msg
Definition: mps_check.py:285
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::ThreadSafeOutputFileStream::waitingMessages_
tbb::concurrent_queue< std::string > waitingMessages_
Definition: ThreadSafeOutputFileStream.h:22
edm::ThreadSafeOutputFileStream::ThreadSafeOutputFileStream
ThreadSafeOutputFileStream(std::string const &name)
Definition: ThreadSafeOutputFileStream.cc:7
ThreadSafeOutputFileStream.h
edm::ThreadSafeOutputFileStream::msgBeingLogged_
std::atomic< bool > msgBeingLogged_
Definition: ThreadSafeOutputFileStream.h:21
edm::ThreadSafeOutputFileStream::write
void write(std::string &&msg)
Definition: ThreadSafeOutputFileStream.cc:17
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ThreadSafeOutputFileStream::file_
std::ofstream file_
Definition: ThreadSafeOutputFileStream.h:20