aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Common/EventFD.h
blob: 95ecdc20dd603798a55ec817d83caa7d1f375013 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#if defined(OS_LINUX)

#include <cstddef>
#include <cstdint>


namespace DB
{

struct EventFD
{
    EventFD();
    ~EventFD();

    /// Both read() and write() are blocking.
    /// TODO: add non-blocking flag to ctor.
    uint64_t read() const;
    bool write(uint64_t increase = 1) const;

    int fd = -1;
};

}

#else

namespace DB
{

struct EventFD
{
};

}

#endif