Adding standard UNIX/POSIX signals listener. GNSS-SDR now can be safely stopped using CTL+C

This commit is contained in:
Javier Arribas
2023-09-30 14:48:04 +02:00
parent a39144105c
commit b971b61eed
2 changed files with 47 additions and 0 deletions
+7
View File
@@ -37,6 +37,7 @@
#include <typeinfo> // for std::type_info, typeid
#include <utility> // for pair
#include <vector> // for vector
#include <csignal>
#ifdef ENABLE_FPGA
#include <boost/thread.hpp> // for boost::thread
@@ -54,6 +55,7 @@ class ConfigurationInterface;
class GNSSFlowgraph;
class Gnss_Satellite;
/*!
* \brief This class represents the main thread of the application, so the name is ControlThread.
* This is the GNSS Receiver Control Plane: it connects the flowgraph, starts running it,
@@ -63,6 +65,8 @@ class Gnss_Satellite;
class ControlThread
{
public:
static ControlThread* me;
/*!
* \brief Default constructor
*/
@@ -122,6 +126,9 @@ public:
}
private:
static void handle_signal(int sig);
void init();
void apply_action(unsigned int what);