Main Page
Namespaces
Classes
Package Documentation
FWCore
MessageService
src
MainThreadMLscribe.cc
Go to the documentation of this file.
1
// ----------------------------------------------------------------------
2
//
3
// MainThreadMLscribe.cc
4
//
5
// Changes:
6
//
7
//
8
9
#include "
FWCore/MessageService/interface/MainThreadMLscribe.h
"
10
#include "
FWCore/MessageService/interface/ThreadQueue.h
"
11
#include "
FWCore/MessageLogger/interface/ConfigurationHandshake.h
"
12
13
namespace
edm
{
14
namespace
service
{
15
16
MainThreadMLscribe::MainThreadMLscribe
(std::shared_ptr<ThreadQueue> tqp) : m_queue(tqp) {}
17
18
MainThreadMLscribe::~MainThreadMLscribe
() {}
19
20
void
MainThreadMLscribe::runCommand
(
MessageLoggerQ::OpCode
opcode,
void
*operand) {
21
if
(
MessageLoggerQ::handshaked
(opcode)) {
22
Place_for_passing_exception_ptr
epp(
new
Pointer_to_new_exception_on_heap
());
23
ConfigurationHandshake
h
(operand, epp);
24
void
*
v
(static_cast<void *>(&h));
25
Pointer_to_new_exception_on_heap
ep
;
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
43
44
}
// end of namespace service
45
}
// end of namespace edm
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition:
SiStripBadComponentsDQMServiceTemplate_cfg.py:86
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition:
L1TUtmAlgorithmRcd.h:4
edm::MessageLoggerQ::handshaked
static bool handshaked(const OpCode &op)
Definition:
MessageLoggerQ.cc:186
ConfigurationHandshake.h
edm::service::MainThreadMLscribe::~MainThreadMLscribe
~MainThreadMLscribe() override
Definition:
MainThreadMLscribe.cc:18
ThreadQueue.h
findQualityFiles.v
v
Definition:
findQualityFiles.py:179
edm::ConfigurationHandshake
Definition:
ConfigurationHandshake.h:15
MainThreadMLscribe.h
edm::ConfigurationHandshake::m
std::mutex m
Definition:
ConfigurationHandshake.h:17
edm::ConfigurationHandshake::epp
edm::Place_for_passing_exception_ptr epp
Definition:
ConfigurationHandshake.h:19
edm::MessageLoggerQ::OpCode
OpCode
Definition:
MessageLoggerQ.h:26
edm::service::MainThreadMLscribe::m_queue
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
Definition:
MainThreadMLscribe.h:50
edm::Exception
Definition:
EDMException.h:77
service
Definition:
service.py:1
edm::ConfigurationHandshake::c
std::condition_variable c
Definition:
ConfigurationHandshake.h:18
edm
HLT enums.
Definition:
AlignableModifier.h:19
edm::service::MainThreadMLscribe::MainThreadMLscribe
MainThreadMLscribe(std::shared_ptr< ThreadQueue > tqp)
Definition:
MainThreadMLscribe.cc:16
edm::service::MainThreadMLscribe::runCommand
void runCommand(MessageLoggerQ::OpCode opcode, void *operand) override
Definition:
MainThreadMLscribe.cc:20
edm::Place_for_passing_exception_ptr
std::shared_ptr< Pointer_to_new_exception_on_heap > Place_for_passing_exception_ptr
Definition:
ConfigurationHandshake.h:13
edm::Pointer_to_new_exception_on_heap
std::shared_ptr< edm::Exception > Pointer_to_new_exception_on_heap
Definition:
ConfigurationHandshake.h:10
Generated for CMSSW Reference Manual by
1.8.11