mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
log_writer_file: fix corner case when mission log is enabled
Normally _should_run for mission is only ever true if _should_run for the normal log is. There are exceptions though: - the log buffer fails to allocate - there was a write failure (e.g. due to SD card removal) In that situation, the writer would not wait anymore but busy-loop.
This commit is contained in:
parent
ebbe08bc86
commit
8d36ba6727
@ -484,7 +484,7 @@ void LogWriterFile::run()
|
||||
* not an issue because notify() is called regularly.
|
||||
* If the logger was switched off in the meantime, do not wait for data, instead run this loop
|
||||
* once more to write remaining data and close the file. */
|
||||
if (_buffers[0]._should_run) {
|
||||
if (_buffers[0]._should_run || _buffers[1]._should_run) {
|
||||
pthread_cond_wait(&_cv, &_mtx);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user