mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
GH-773: Make EventMgr an IOSource so that events interrupt kevent waits
This commit is contained in:
parent
5171f25e3a
commit
4f23c0360a
6 changed files with 59 additions and 9 deletions
10
src/Event.h
10
src/Event.h
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "BroList.h"
|
||||
#include "analyzer/Analyzer.h"
|
||||
#include "iosource/IOSource.h"
|
||||
#include "Flare.h"
|
||||
|
||||
class EventMgr;
|
||||
|
||||
|
@ -49,7 +51,7 @@ protected:
|
|||
extern uint64_t num_events_queued;
|
||||
extern uint64_t num_events_dispatched;
|
||||
|
||||
class EventMgr : public BroObj {
|
||||
class EventMgr : public BroObj, public iosource::IOSource {
|
||||
public:
|
||||
EventMgr();
|
||||
~EventMgr() override;
|
||||
|
@ -113,6 +115,11 @@ public:
|
|||
|
||||
void Describe(ODesc* d) const override;
|
||||
|
||||
double GetNextTimeout() override { return -1; }
|
||||
void Process() override;
|
||||
const char* Tag() override { return "EventManager"; }
|
||||
void InitPostScript();
|
||||
|
||||
protected:
|
||||
void QueueEvent(Event* event);
|
||||
|
||||
|
@ -123,6 +130,7 @@ protected:
|
|||
TimerMgr* current_mgr;
|
||||
RecordVal* src_val;
|
||||
bool draining;
|
||||
bro::Flare queue_flare;
|
||||
};
|
||||
|
||||
extern EventMgr mgr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue