mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-18 21:23:02 +00:00
Fix occasional segfault when exiting with enter+q if Acquisition_XX.blocking=false
This commit is contained in:
parent
ad5690c52f
commit
a091b18062
@ -67,6 +67,8 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
|
||||
parameters for the `DataTypeAdapter`, `InputFilter` and `Resampler` blocks are
|
||||
ignored. This was the default behavior in GNSS-SDR v0.0.12, but it changed in
|
||||
v0.0.13. This change recovers the old behavior.
|
||||
- Fixed occasional segmentation fault when exiting with `q` + `[Enter]` keys if
|
||||
`Acquisition_XX.blocking=false`.
|
||||
- Fixed the termination of the receiver with `q` + `[Enter]` keys when using the
|
||||
`Osmosdr_Signal_Source` implementation of the `SignalSource` block.
|
||||
- The `Labsat_Signal_Source` implementation of the `SignalSource` block now can
|
||||
|
@ -75,7 +75,6 @@ target_link_libraries(acquisition_gr_blocks
|
||||
Armadillo::armadillo
|
||||
Gnuradio::runtime
|
||||
Gnuradio::fft
|
||||
Threads::Threads
|
||||
Volk::volk
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
PRIVATE
|
||||
|
@ -659,8 +659,6 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
<< ", doppler_step: " << d_doppler_step
|
||||
<< ", use_CFAR_algorithm_flag: " << (d_use_CFAR_algorithm_flag ? "true" : "false");
|
||||
|
||||
lk.unlock();
|
||||
|
||||
// Doppler frequency grid loop
|
||||
if (!d_step_two)
|
||||
{
|
||||
@ -782,7 +780,6 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
}
|
||||
}
|
||||
|
||||
lk.lock();
|
||||
if (!d_acq_parameters.bit_transition_flag)
|
||||
{
|
||||
if (d_test_statistics > d_threshold)
|
||||
@ -872,7 +869,6 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
send_negative_acquisition();
|
||||
}
|
||||
}
|
||||
d_worker_active = false;
|
||||
|
||||
if ((d_num_noncoherent_integrations_counter == d_acq_parameters.max_dwells) or (d_positive_acq == 1))
|
||||
{
|
||||
@ -884,6 +880,8 @@ void pcps_acquisition::acquisition_core(uint64_t samp_count)
|
||||
d_num_noncoherent_integrations_counter = 0U;
|
||||
d_positive_acq = 0;
|
||||
}
|
||||
|
||||
d_worker_active = false;
|
||||
}
|
||||
|
||||
|
||||
@ -930,11 +928,7 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
|
||||
* 6. Declare positive or negative acquisition using a message port
|
||||
*/
|
||||
gr::thread::scoped_lock lk(d_setlock);
|
||||
if (!d_active and d_worker_active and !d_acq_parameters.blocking)
|
||||
{
|
||||
pthread_cancel(d_id_worker);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!d_active or d_worker_active)
|
||||
{
|
||||
if (!d_acq_parameters.blocking_on_standby)
|
||||
@ -1022,7 +1016,6 @@ int pcps_acquisition::general_work(int noutput_items __attribute__((unused)),
|
||||
else
|
||||
{
|
||||
d_worker = std::thread([&] { pcps_acquisition::acquisition_core(d_sample_counter); });
|
||||
d_id_worker = d_worker.native_handle();
|
||||
d_worker.detach();
|
||||
d_worker_active = true;
|
||||
}
|
||||
|
@ -59,7 +59,6 @@
|
||||
#include <complex>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <pthread.h>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
@ -261,7 +260,6 @@ private:
|
||||
|
||||
std::string d_dump_filename;
|
||||
std::thread d_worker;
|
||||
pthread_t d_id_worker;
|
||||
|
||||
int64_t d_dump_number;
|
||||
uint64_t d_sample_counter;
|
||||
|
Loading…
Reference in New Issue
Block a user