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)
 
virtual void runCommand (MessageLoggerQ::OpCode opcode, void *operand)
 
virtual ~MainThreadMLscribe ()
 
- 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.

17  : m_queue(tqp)
18 {
19 }
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
edm::service::MainThreadMLscribe::~MainThreadMLscribe ( )
virtual

Definition at line 21 of file MainThreadMLscribe.cc.

References runCommand().

21 {}

Member Function Documentation

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

Reimplemented from edm::service::AbstractMLscribe.

Definition at line 25 of file MainThreadMLscribe.cc.

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

Referenced by ~MainThreadMLscribe().

26 {
27  if (MessageLoggerQ::handshaked(opcode)) {
29  ConfigurationHandshake h(operand,epp);
30  void * v(static_cast<void *>(&h));
32  {
33  std::unique_lock<std::mutex> sl(h.m); // get lock
34  m_queue->produce (opcode, v);
35  // wait for result to appear (in epp)
36  h.c.wait(sl); // c.wait(sl) unlocks the scoped lock and sleeps till notified
37  // ... and once the MessageLoggerScribe does h.c.notify_all() ...
38  ep = *h.epp;
39  // finally, release the scoped lock by letting it go out of scope
40  }
41  if ( ep ) {
42  edm::Exception ex(*ep);
43  throw ex;
44  }
45  } else {
46  m_queue->produce (opcode, operand);
47  }
48 } // 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 53 of file MainThreadMLscribe.h.

Referenced by runCommand().