cluck 1.0.1
The cluster lock service.
interrupt.cpp
Go to the documentation of this file.
1// Copyright (c) 2016-2025 Made to Order Software Corp. All Rights Reserved
2//
3// https://snapwebsites.org/project/cluck
4// contact@m2osw.com
5//
6// This program is free software: you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation, either version 3 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with this program. If not, see <https://www.gnu.org/licenses/>.
18
19
20// self
21//
22#include "interrupt.h"
23
24#include "cluckd.h"
25
26
27// last include
28//
29#include <snapdev/poison.h>
30
31
32
33namespace cluck_daemon
34{
35
56 : signal(SIGINT)
57 , f_cluckd(c)
58{
59 unblock_signal_on_destruction();
60 set_name("interrupt");
61}
62
63
67
68
75{
76 // we simulate the STOP, so pass 'false' (i.e. not quitting)
77 //
78 f_cluckd->stop(false);
79}
80
81
82
83} // namespace cluck_daemon
84// vim: ts=4 sw=4 et
Class handling intercomputer locking.
Definition cluckd.h:48
void stop(bool quitting)
Called whenever we receive the STOP command or equivalent.
Definition cluckd.cpp:1284
interrupt(cluckd *c)
The interrupt initialization.
Definition interrupt.cpp:55
virtual ~interrupt() override
Definition interrupt.cpp:64
virtual void process_signal() override
Call the stop function of the cluckd object.
Definition interrupt.cpp:74
Daemon handling inter-computer locking.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.