1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-22 04:53:14 +00:00

Merge branch 'fix-asan' into next

This commit is contained in:
Carles Fernandez 2021-10-04 22:29:03 +02:00
commit 2e09b03174
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 8 additions and 3 deletions

View File

@ -60,6 +60,8 @@ DEFINE_string(RINEX_version, "-", "If defined, specifies the RINEX version (2.11
DEFINE_string(RINEX_name, "-", "If defined, specifies the RINEX files base name");
DEFINE_bool(keyboard, true, "If set to false, it disables the keyboard listener (so the receiver cannot be stopped with [Enter]+q)");
#if GFLAGS_GREATER_2_0
static bool ValidateC(const char* flagname, const std::string& value)

View File

@ -59,7 +59,7 @@ const int32_t DEFAULT_CARRIER_SMOOTHING_FACTOR = 200;
// Declare flags for PVT
DECLARE_string(RINEX_version); //!< If defined, specifies the RINEX version (2.11 or 3.02). Overrides the configuration file.
DECLARE_string(RINEX_name); //!< If defined, specifies the RINEX files base name
DECLARE_bool(keyboard); //!< If set to false, disables the keyboard listener. Only for debug purposes (e.g. ASAN mode termination)
/** \} */
/** \} */

View File

@ -369,7 +369,10 @@ int ControlThread::run()
// launch GNSS assistance process AFTER the flowgraph is running because the GNU Radio asynchronous queues must be already running to transport msgs
assist_GNSS();
// start the keyboard_listener thread
keyboard_thread_ = std::thread(&ControlThread::keyboard_listener, this);
if (FLAGS_keyboard)
{
keyboard_thread_ = std::thread(&ControlThread::keyboard_listener, this);
}
sysv_queue_thread_ = std::thread(&ControlThread::sysv_queue_listener, this);
// start the telecommand listener thread
@ -405,7 +408,7 @@ int ControlThread::run()
#endif
// Terminate keyboard thread
if (keyboard_thread_.joinable())
if (FLAGS_keyboard && keyboard_thread_.joinable())
{
pthread_t id = keyboard_thread_.native_handle();
keyboard_thread_.detach();