mirror of
https://github.com/Icinga/icinga2.git
synced 2025-09-26 11:08:51 +02:00
WIP
This commit is contained in:
parent
1a756f2d85
commit
3e1fd1da14
@ -98,6 +98,12 @@ Checkable::ProcessingResult Checkable::ProcessCheckResult(const CheckResult::Ptr
|
||||
{
|
||||
using Result = Checkable::ProcessingResult;
|
||||
|
||||
std::shared_lock<std::shared_timed_mutex> preventStop (m_ProcessCheckResultMutex, std::try_to_lock);
|
||||
|
||||
if (!preventStop) {
|
||||
return Result::CheckableInactive;
|
||||
}
|
||||
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
m_CheckRunning = false;
|
||||
|
@ -113,6 +113,13 @@ void Checkable::Start(bool runtimeCreated)
|
||||
});
|
||||
}
|
||||
|
||||
void Checkable::Stop(bool runtimeRemoved)
|
||||
{
|
||||
m_ProcessCheckResultMutex.lock();
|
||||
|
||||
ObjectImpl<Checkable>::Stop(runtimeRemoved);
|
||||
}
|
||||
|
||||
void Checkable::AddGroup(const String& name)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_CheckableMutex);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <shared_mutex>
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
@ -210,11 +211,13 @@ public:
|
||||
|
||||
protected:
|
||||
void Start(bool runtimeCreated) override;
|
||||
void Stop(bool runtimeRemoved) override;
|
||||
void OnConfigLoaded() override;
|
||||
void OnAllConfigLoaded() override;
|
||||
|
||||
private:
|
||||
mutable std::mutex m_CheckableMutex;
|
||||
mutable std::shared_timed_mutex m_ProcessCheckResultMutex;
|
||||
bool m_CheckRunning{false};
|
||||
long m_SchedulingOffset;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user