Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2026-04-30 9f2ef60949ced4fab4d077a7e1c6d913f3620c9b
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
39
40
41
42
43
44
45
46
47
48
49
50
#pragma once
 
/**
 * To enable this by the program, define USE_WAGYU_INTERRUPT before including wagyu.hpp
 * To request an interruption, call `interrupt_request()`. As soon as Wagyu detects the request
 * it will raise an exception (`std::runtime_error`).
 */
 
#ifdef USE_WAGYU_INTERRUPT
 
namespace {
thread_local bool WAGYU_INTERRUPT_REQUESTED = false;
}
 
namespace mapbox {
namespace geometry {
namespace wagyu {
 
static void interrupt_reset(void) {
    WAGYU_INTERRUPT_REQUESTED = false;
}
 
static void interrupt_request(void) {
    WAGYU_INTERRUPT_REQUESTED = true;
}
 
static void interrupt_check(void) {
    if (WAGYU_INTERRUPT_REQUESTED) {
        interrupt_reset();
        throw std::runtime_error("Wagyu interrupted");
    }
}
} // namespace wagyu
} // namespace geometry
} // namespace mapbox
 
#else /* ! USE_WAGYU_INTERRUPT */
 
namespace mapbox {
namespace geometry {
namespace wagyu {
 
static void interrupt_check(void) {
}
 
} // namespace wagyu
} // namespace geometry
} // namespace mapbox
 
#endif /* USE_WAGYU_INTERRUPT */