#include <MainThreadMLscribe.h>
Public Member Functions | |
MainThreadMLscribe (boost::shared_ptr< ThreadQueue > tqp) | |
virtual void | runCommand (MessageLoggerQ::OpCode opcode, void *operand) |
virtual | ~MainThreadMLscribe () |
Static Public Member Functions | |
static ErrorLog * | getErrorLog_ptr () |
Private Attributes | |
boost::shared_ptr< ThreadQueue > | m_queue |
Static Private Attributes | |
static ErrorLog * | static_errorlog_p |
Definition at line 39 of file MainThreadMLscribe.h.
edm::service::MainThreadMLscribe::MainThreadMLscribe | ( | boost::shared_ptr< ThreadQueue > | tqp | ) |
Definition at line 16 of file MainThreadMLscribe.cc.
: m_queue(tqp) { }
edm::service::MainThreadMLscribe::~MainThreadMLscribe | ( | ) | [virtual] |
Definition at line 21 of file MainThreadMLscribe.cc.
{}
static ErrorLog* edm::service::MainThreadMLscribe::getErrorLog_ptr | ( | ) | [inline, static] |
Definition at line 52 of file MainThreadMLscribe.h.
References static_errorlog_p.
{return static_errorlog_p;}
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 v.
{ if (MessageLoggerQ::handshaked(opcode)) { Place_for_passing_exception_ptr epp(new Pointer_to_new_exception_on_heap()); ConfigurationHandshake h(operand,epp); void * v(static_cast<void *>(&h)); Pointer_to_new_exception_on_heap ep; { boost::mutex::scoped_lock sl(h.m); // get lock m_queue->produce (opcode, v); // wait for result to appear (in epp) h.c.wait(sl); // c.wait(sl) unlocks the scoped lock and sleeps till notified // ... and once the MessageLoggerScribe does h.c.notify_all() ... ep = *h.epp; // finally, release the scoped lock by letting it go out of scope } if ( ep ) { edm::Exception ex(*ep); throw ex; } } else { m_queue->produce (opcode, operand); } } // runCommand
boost::shared_ptr<ThreadQueue> edm::service::MainThreadMLscribe::m_queue [private] |
Definition at line 57 of file MainThreadMLscribe.h.
Referenced by runCommand().
ErrorLog* edm::service::MainThreadMLscribe::static_errorlog_p [static, private] |
Definition at line 56 of file MainThreadMLscribe.h.
Referenced by getErrorLog_ptr().