CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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_
def move
Definition: eostools.py:510
ThreadSafeOutputFileStream(std::string const &name)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100