Nix
2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
monitor-fd.hh
1
#pragma once
4
5
#include <thread>
6
#include <atomic>
7
8
#include <poll.h>
9
#include <sys/types.h>
10
#include <unistd.h>
11
12
#include "
lix/libutil/error.hh
"
13
#include "
lix/libutil/file-descriptor.hh
"
14
#include "lix/libutil/signals.hh"
15
#include "
lix/libutil/thread-name.hh
"
16
17
namespace
nix {
18
20
class
MonitorFdHup
21
{
22
private
:
23
std::thread thread;
27
Pipe
terminatePipe;
28
std::atomic_bool quit =
false
;
29
std::function<void()> callback;
30
31
void
runThread(
int
watchFd,
int
terminateFd);
32
33
public
:
34
MonitorFdHup(
int
fd, std::function<
void
()> callback = nix::triggerInterrupt);
35
36
~MonitorFdHup();
37
};
38
39
40
}
nix::Pipe
Definition
file-descriptor.hh:79
error.hh
This file defines two main structs/classes used in nix error handling.
file-descriptor.hh
thread-name.hh
lix
libutil
monitor-fd.hh
Generated by
1.15.0