CMS 3D CMS Logo

MainThreadMLscribe.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // MainThreadMLscribe.cc
4 //
5 // Changes:
6 //
7 //
8 
12 
13 namespace edm {
14  namespace service {
15 
16  MainThreadMLscribe::MainThreadMLscribe(std::shared_ptr<ThreadQueue> tqp) : m_queue(tqp) {}
17 
19 
21  if (MessageLoggerQ::handshaked(opcode)) {
23  ConfigurationHandshake h(operand, epp);
24  void *v(static_cast<void *>(&h));
26  {
27  std::unique_lock<std::mutex> sl(h.m); // get lock
28  m_queue->produce(opcode, v);
29  // wait for result to appear (in epp)
30  h.c.wait(sl); // c.wait(sl) unlocks the scoped lock and sleeps till notified
31  // ... and once the MessageLoggerScribe does h.c.notify_all() ...
32  ep = *h.epp;
33  // finally, release the scoped lock by letting it go out of scope
34  }
35  if (ep) {
36  edm::Exception ex(*ep);
37  throw ex;
38  }
39  } else {
40  m_queue->produce(opcode, operand);
41  }
42  } // runCommand
43 
44  } // end of namespace service
45 } // end of namespace edm
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static bool handshaked(const OpCode &op)
edm::Place_for_passing_exception_ptr epp
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
HLT enums.
MainThreadMLscribe(std::shared_ptr< ThreadQueue > tqp)
void runCommand(MessageLoggerQ::OpCode opcode, void *operand) override
std::shared_ptr< Pointer_to_new_exception_on_heap > Place_for_passing_exception_ptr
std::shared_ptr< edm::Exception > Pointer_to_new_exception_on_heap