CMS 3D CMS Logo

ThreadQueue.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------
2 //
3 // ThreadQueue.cc
4 //
5 // Changes:
6 //
7 //
8 
10 #include <cstring>
11 
12 namespace edm {
13  namespace service {
14 
15  ThreadQueue::ThreadQueue() : m_buf(buf_size, buf_depth) {}
17 
20  char *slot_p = static_cast<char *>(b.buffer());
21  void *v = operand;
22  std::memcpy(slot_p + 0, &o, sizeof(MessageLoggerQ::OpCode));
23  std::memcpy(slot_p + sizeof(MessageLoggerQ::OpCode), &v, sizeof(void *));
24  b.commit(buf_size);
25  } // runCommand
26 
27  void ThreadQueue::consume(MessageLoggerQ::OpCode &opcode, void *&operand) {
28  SingleConsumerQ::ConsumerBuffer b(m_buf); // Look -- CONSUMER buffer
29  char *slot_p = static_cast<char *>(b.buffer());
30  std::memcpy(&opcode, slot_p + 0, sizeof(MessageLoggerQ::OpCode));
31  std::memcpy(&operand, slot_p + sizeof(MessageLoggerQ::OpCode), sizeof(void *));
32  b.commit(buf_size);
33  }
34 
35  } // end of namespace service
36 } // end of namespace edm
double b
Definition: hdecay.h:120
void consume(MessageLoggerQ::OpCode &opcode, void *&operand)
Definition: ThreadQueue.cc:27
HLT enums.
void produce(MessageLoggerQ::OpCode opcode, void *operand)
Definition: ThreadQueue.cc:18
static const int buf_size
Definition: ThreadQueue.h:53
SingleConsumerQ m_buf
Definition: ThreadQueue.h:54