Definition at line 18 of file HLTMainLoop.h.
◆ HLTMainLoop()
◆ initSignalHandler()
void initSignalHandler |
( |
| ) |
const |
|
private |
Definition at line 37 of file HLTMainLoop.cc.
38{
39 struct sigaction action;
40 action.sa_handler = signalHandler;
41 action.sa_flags = 0;
42 sigemptyset(&action.sa_mask);
43 sigaction(SIGINT, &action, NULL);
44 sigaction(SIGTERM, &action, NULL);
45}
◆ isRunning()
Definition at line 32 of file HLTMainLoop.cc.
33{
34 return not s_interrupted;
35}
◆ readFromRingBufferWaiting()
int readFromRingBufferWaiting |
( |
RingBuffer * |
ringBuffer, |
|
|
int * |
buffer |
|
) |
| const |
Definition at line 61 of file HLTMainLoop.cc.
62{
63 int bsize = 0;
64 while ((bsize = ringBuffer->
remq(buffer)) == 0 and isRunning()) {
65 std::this_thread::sleep_for(20us);
66 }
67
68 return bsize;
69}
int remq(int *buf)
Pick up a buffer from the RingBuffer.
◆ signalHandler()
void signalHandler |
( |
int |
signalValue | ) |
|
|
staticprivate |
Definition at line 21 of file HLTMainLoop.cc.
22{
23 B2RESULT("Termination request...");
24 HLTMainLoop::s_interrupted = true;
25}
◆ writeToRingBufferWaiting()
int writeToRingBufferWaiting |
( |
RingBuffer * |
ringBuffer, |
|
|
int * |
buffer, |
|
|
unsigned int |
size |
|
) |
| const |
Definition at line 47 of file HLTMainLoop.cc.
48{
49 int irb = 0;
50 while (isRunning()) {
51 irb = ringBuffer->
insq(buffer, size);
52 if (irb >= 0) {
53 break;
54 }
55 std::this_thread::sleep_for(20us);
56 }
57
58 return irb;
59}
int insq(const int *buf, int size, bool checkTx=false)
Append a buffer to the RingBuffer.
◆ s_interrupted
bool s_interrupted = false |
|
staticprivate |
The documentation for this class was generated from the following files: