CMS 3D CMS Logo

ThreadSafeOutputFileStream.cc
Go to the documentation of this file.
2 
3 #include <sstream>
4 
5 namespace edm {
6 
8  : file_{name}
9  {}
10 
12  {
14  while (waitingMessages_.try_pop(tmp)) {
15  file_ << tmp;
16  }
17  file_.close();
18  }
19 
20  void
22  {
24  bool expected {false};
25  if (msgBeingLogged_.compare_exchange_strong(expected, true)) {
27  while (waitingMessages_.try_pop(tmp)) {
28  file_ << tmp;
29  }
30  msgBeingLogged_.store(false);
31  }
32  }
33 }
tbb::concurrent_queue< std::string > waitingMessages_
ThreadSafeOutputFileStream(std::string const &name)
tuple msg
Definition: mps_check.py:278
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
HLT enums.
def move(src, dest)
Definition: eostools.py:511