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)
17
: m_queue(tqp)
18
{
19
}
20
21
MainThreadMLscribe::~MainThreadMLscribe
() {}
22
23
void
24
MainThreadMLscribe::
25
runCommand
(
MessageLoggerQ::OpCode
opcode,
void
* operand)
26
{
27
if
(
MessageLoggerQ::handshaked
(opcode)) {
28
Place_for_passing_exception_ptr
epp(
new
Pointer_to_new_exception_on_heap
());
29
ConfigurationHandshake
h
(operand,epp);
30
void
*
v
(static_cast<void *>(&h));
31
Pointer_to_new_exception_on_heap
ep;
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
49
50
51
52
}
// end of namespace service
53
}
// end of namespace edm
edm::MessageLoggerQ::handshaked
static bool handshaked(const OpCode &op)
Definition:
MessageLoggerQ.cc:243
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition:
L1TUtmAlgorithmRcd.h:4
ConfigurationHandshake.h
ThreadQueue.h
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
edm::ConfigurationHandshake
Definition:
ConfigurationHandshake.h:15
edm::service::MainThreadMLscribe::~MainThreadMLscribe
virtual ~MainThreadMLscribe()
Definition:
MainThreadMLscribe.cc:21
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:29
edm::service::MainThreadMLscribe::m_queue
edm::propagate_const< std::shared_ptr< ThreadQueue > > m_queue
Definition:
MainThreadMLscribe.h:53
edm::Exception
Definition:
EDMException.h:71
service
Definition:
service.py:1
edm::ConfigurationHandshake::c
std::condition_variable c
Definition:
ConfigurationHandshake.h:18
edm
HLT enums.
Definition:
AlignableModifier.h:17
edm::service::MainThreadMLscribe::MainThreadMLscribe
MainThreadMLscribe(std::shared_ptr< ThreadQueue > tqp)
Definition:
MainThreadMLscribe.cc:16
edm::service::MainThreadMLscribe::runCommand
virtual void runCommand(MessageLoggerQ::OpCode opcode, void *operand)
Definition:
MainThreadMLscribe.cc:25
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