Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
signals-impl.hh File Reference
#include "nix/util/types.hh"
#include "nix/util/fun.hh"
#include <memory>

Go to the source code of this file.

Classes

struct  nix::ReceiveInterrupts

Functions

void nix::checkInterrupt ()
std::unique_ptr< InterruptCallback > nix::createSignalCallback (SignalType type, fun< void()> callback)
std::unique_ptr< InterruptCallback > nix::createInterruptCallback (fun< void()> callback)

Function Documentation

◆ checkInterrupt()

void nix::checkInterrupt ( )
inline
Note
Does nothing on Windows

Throw Interrupted exception if the process has been interrupted.

Call this in long-running loops and between slow operations to terminate them as needed.

◆ createInterruptCallback()

std::unique_ptr< InterruptCallback > nix::createInterruptCallback ( fun< void()> callback)
inline

Register a function that gets called on SIGINT (in a non-signal context).

Note
Does nothing on Windows

◆ createSignalCallback()

std::unique_ptr< InterruptCallback > nix::createSignalCallback ( SignalType type,
fun< void()> callback )
inline

Register a function that gets called from the signal handler thread (in a non-signal context) when the given signal type is received.

Note
Does nothing on Windows