mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Run expiration on a separate thread
This commit is contained in:
parent
cad48cebd4
commit
40f60f26b3
4 changed files with 44 additions and 10 deletions
|
@ -3,7 +3,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#include "zeek/3rdparty/jthread.hpp"
|
||||
#include "zeek/Timer.h"
|
||||
#include "zeek/plugin/ComponentManager.h"
|
||||
#include "zeek/storage/Backend.h"
|
||||
|
@ -65,10 +67,13 @@ public:
|
|||
*/
|
||||
ErrorResult CloseBackend(BackendPtr backend, ErrorResultCallback* cb = nullptr);
|
||||
|
||||
void Expire();
|
||||
|
||||
protected:
|
||||
friend class storage::detail::ExpirationTimer;
|
||||
void Expire();
|
||||
void RunExpireThread();
|
||||
void StartExpirationTimer();
|
||||
std::jthread expiration_thread;
|
||||
|
||||
friend class storage::OpenResultCallback;
|
||||
void RegisterBackend(BackendPtr backend);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue