mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Move threading classes to zeek namespaces
This commit is contained in:
parent
f310795d79
commit
1262109e5a
42 changed files with 299 additions and 210 deletions
|
@ -7,7 +7,9 @@
|
|||
#include <list>
|
||||
#include <utility>
|
||||
|
||||
namespace zeek {
|
||||
namespace threading {
|
||||
namespace detail {
|
||||
|
||||
class HeartbeatTimer final : public zeek::detail::Timer {
|
||||
public:
|
||||
|
@ -21,6 +23,8 @@ protected:
|
|||
void Init();
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
/**
|
||||
* The thread manager coordinates all child threads. Once a BasicThread is
|
||||
* instantitated, it gets addedd to the manager, which will delete it later
|
||||
|
@ -103,7 +107,7 @@ public:
|
|||
protected:
|
||||
friend class BasicThread;
|
||||
friend class MsgThread;
|
||||
friend class HeartbeatTimer;
|
||||
friend class detail::HeartbeatTimer;
|
||||
|
||||
/**
|
||||
* Registers a new basic thread with the manager. This is
|
||||
|
@ -151,10 +155,21 @@ private:
|
|||
bool heartbeat_timer_running = false;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace threading
|
||||
|
||||
/**
|
||||
* A singleton instance of the thread manager. All methods must only be
|
||||
* called from Bro's main thread.
|
||||
* called from Zeek's main thread.
|
||||
*/
|
||||
extern threading::Manager* thread_mgr;
|
||||
|
||||
} // namespace zeek
|
||||
|
||||
extern zeek::threading::Manager*& thread_mgr [[deprecated("Remove in v4.1. Use zeek::thread_mgr.")]];
|
||||
|
||||
namespace threading::detail {
|
||||
using HeartbeatTimer [[deprecated("Remove in v4.1. Use zeek::threading::detail::HeartbeatTimer.")]] = zeek::threading::detail::HeartbeatTimer;
|
||||
}
|
||||
namespace threading {
|
||||
using Manager [[deprecated("Remove in v4.1. Use zeek::threading::Manager.")]] = zeek::threading::Manager;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue