|
|
|
@ -815,7 +815,7 @@ uint16_t AP_Logger_File::get_num_logs()
@@ -815,7 +815,7 @@ uint16_t AP_Logger_File::get_num_logs()
|
|
|
|
|
void AP_Logger_File::stop_logging(void) |
|
|
|
|
{ |
|
|
|
|
// best-case effort to avoid annoying the IO thread
|
|
|
|
|
const bool have_sem = write_fd_semaphore.take(1); |
|
|
|
|
const bool have_sem = write_fd_semaphore.take(hal.util->get_soft_armed()?1:20); |
|
|
|
|
if (_write_fd != -1) { |
|
|
|
|
int fd = _write_fd; |
|
|
|
|
_write_fd = -1; |
|
|
|
@ -823,8 +823,6 @@ void AP_Logger_File::stop_logging(void)
@@ -823,8 +823,6 @@ void AP_Logger_File::stop_logging(void)
|
|
|
|
|
} |
|
|
|
|
if (have_sem) { |
|
|
|
|
write_fd_semaphore.give(); |
|
|
|
|
} else { |
|
|
|
|
AP::internalerror().error(AP_InternalError::error_t::logger_stopping_without_sem); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|