mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 11:02:08 +00:00
33 lines
663 B
C++
33 lines
663 B
C++
#pragma once
|
|
#if defined(OS_LINUX)
|
|
#include <Poco/Timespan.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
/// Wrapper over timerfd.
|
|
class TimerDescriptor
|
|
{
|
|
private:
|
|
int timer_fd;
|
|
|
|
public:
|
|
TimerDescriptor();
|
|
~TimerDescriptor();
|
|
|
|
TimerDescriptor(const TimerDescriptor &) = delete;
|
|
TimerDescriptor & operator=(const TimerDescriptor &) = delete;
|
|
TimerDescriptor(TimerDescriptor && other) noexcept;
|
|
TimerDescriptor & operator=(TimerDescriptor &&) noexcept;
|
|
|
|
int getDescriptor() const { return timer_fd; }
|
|
|
|
void reset() const;
|
|
void drain() const;
|
|
void setRelative(uint64_t usec) const;
|
|
void setRelative(Poco::Timespan timespan) const;
|
|
};
|
|
|
|
}
|
|
#endif
|