CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::service::MainThreadMLscribe Class Reference

#include <MainThreadMLscribe.h>

Inheritance diagram for edm::service::MainThreadMLscribe:
edm::service::AbstractMLscribe

Public Member Functions

 MainThreadMLscribe (std::shared_ptr< ThreadQueue > tqp)
 
void runCommand (MessageLoggerQ::OpCode opcode, void *operand) override
 
 ~MainThreadMLscribe () override
 
- Public Member Functions inherited from edm::service::AbstractMLscribe
 AbstractMLscribe ()
 
virtual ~AbstractMLscribe ()
 

Private Attributes

edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
 

Detailed Description

Definition at line 39 of file MainThreadMLscribe.h.

Constructor & Destructor Documentation

edm::service::MainThreadMLscribe::MainThreadMLscribe ( std::shared_ptr< ThreadQueue tqp)

Definition at line 16 of file MainThreadMLscribe.cc.

16 : m_queue(tqp) {}
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
edm::service::MainThreadMLscribe::~MainThreadMLscribe ( )
override

Definition at line 18 of file MainThreadMLscribe.cc.

18 {}

Member Function Documentation

void edm::service::MainThreadMLscribe::runCommand ( MessageLoggerQ::OpCode  opcode,
void *  operand 
)
overridevirtual

Reimplemented from edm::service::AbstractMLscribe.

Definition at line 20 of file MainThreadMLscribe.cc.

References edm::ConfigurationHandshake::c, edm::ConfigurationHandshake::epp, h, edm::MessageLoggerQ::handshaked(), edm::ConfigurationHandshake::m, m_queue, and findQualityFiles::v.

20  {
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
static bool handshaked(const OpCode &op)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
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

Member Data Documentation

edm::propagate_const<std::shared_ptr<ThreadQueue> > edm::service::MainThreadMLscribe::m_queue
private

Definition at line 50 of file MainThreadMLscribe.h.

Referenced by runCommand().