CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

std::shared_ptr< ThreadQueuem_queue
 

Detailed Description

Definition at line 38 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 }
std::shared_ptr< ThreadQueue > m_queue
edm::service::MainThreadMLscribe::~MainThreadMLscribe ( )
virtual

Definition at line 21 of file MainThreadMLscribe.cc.

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.

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)
std::shared_ptr< ThreadQueue > m_queue
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
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

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

Definition at line 52 of file MainThreadMLscribe.h.

Referenced by runCommand().