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

◆ MainThreadMLscribe()

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

Definition at line 16 of file MainThreadMLscribe.cc.

16 : m_queue(tqp) {}

◆ ~MainThreadMLscribe()

edm::service::MainThreadMLscribe::~MainThreadMLscribe ( )
override

Definition at line 18 of file MainThreadMLscribe.cc.

18 {}

Member Function Documentation

◆ runCommand()

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

Reimplemented from edm::service::AbstractMLscribe.

Definition at line 20 of file MainThreadMLscribe.cc.

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

References SiStripBadComponentsDQMServiceTemplate_cfg::ep, h, edm::MessageLoggerQ::handshaked(), m_queue, and findQualityFiles::v.

Member Data Documentation

◆ m_queue

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

Definition at line 50 of file MainThreadMLscribe.h.

Referenced by runCommand().

h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::Exception
Definition: EDMException.h:77
edm::MessageLoggerQ::handshaked
static bool handshaked(const OpCode &op)
Definition: MessageLoggerQ.cc:186
edm::Place_for_passing_exception_ptr
std::shared_ptr< Pointer_to_new_exception_on_heap > Place_for_passing_exception_ptr
Definition: ConfigurationHandshake.h:13
h
edm::service::MainThreadMLscribe::m_queue
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
Definition: MainThreadMLscribe.h:50
edm::Pointer_to_new_exception_on_heap
std::shared_ptr< edm::Exception > Pointer_to_new_exception_on_heap
Definition: ConfigurationHandshake.h:10
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86