Make noncopyable

This commit is contained in:
Dmitry Novik 2022-05-18 01:42:13 +00:00
parent a97ba9741e
commit 20c537addd

View File

@ -155,11 +155,15 @@ private:
Poco::Logger * logger = &Poco::Logger::get("GlobalOvercommitTracker");
};
// This class is used to disallow tracking during logging to avoid deadlocks.
struct OvercommitTrackerBlockerInThread
{
OvercommitTrackerBlockerInThread() { ++counter; }
~OvercommitTrackerBlockerInThread() { --counter; }
OvercommitTrackerBlockerInThread(OvercommitTrackerBlockerInThread const &) = delete;
OvercommitTrackerBlockerInThread & operator=(OvercommitTrackerBlockerInThread const &) = delete;
static bool isBlocked() { return counter > 0; }
private: