Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
(boost::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
boost::mutex::scoped_lock 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:251
ConfigurationHandshake.h
edm::ConfigurationHandshake::c
boost::condition c
Definition:
ConfigurationHandshake.h:18
ThreadQueue.h
findQualityFiles.v
v
Definition:
findQualityFiles.py:177
edm::Pointer_to_new_exception_on_heap
boost::shared_ptr< edm::Exception > Pointer_to_new_exception_on_heap
Definition:
ConfigurationHandshake.h:10
edm::ConfigurationHandshake
Definition:
ConfigurationHandshake.h:15
edm::service::MainThreadMLscribe::~MainThreadMLscribe
virtual ~MainThreadMLscribe()
Definition:
MainThreadMLscribe.cc:21
MainThreadMLscribe.h
edm::ConfigurationHandshake::epp
edm::Place_for_passing_exception_ptr epp
Definition:
ConfigurationHandshake.h:19
edm::MessageLoggerQ::OpCode
OpCode
Definition:
MessageLoggerQ.h:29
edm::ConfigurationHandshake::m
boost::mutex m
Definition:
ConfigurationHandshake.h:17
edm::Place_for_passing_exception_ptr
boost::shared_ptr< Pointer_to_new_exception_on_heap > Place_for_passing_exception_ptr
Definition:
ConfigurationHandshake.h:13
edm::Exception
Definition:
EDMException.h:72
edm::service::MainThreadMLscribe::MainThreadMLscribe
MainThreadMLscribe(boost::shared_ptr< ThreadQueue > tqp)
Definition:
MainThreadMLscribe.cc:16
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition:
Activities.doc:4
edm::service::MainThreadMLscribe::runCommand
virtual void runCommand(MessageLoggerQ::OpCode opcode, void *operand)
Definition:
MainThreadMLscribe.cc:25
edm::service::MainThreadMLscribe::m_queue
boost::shared_ptr< ThreadQueue > m_queue
Definition:
MainThreadMLscribe.h:57
Generated for CMSSW Reference Manual by
1.8.5