mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 08:40:30 +08:00
logger: proper error handling if writer thread creation fails
This commit is contained in:
1 parent
72263eaa97
commit
84015e5c01
3 files changed
+16
-11
No files matched your search
@@ -402,7 +402,12 @@ void Logger::run()
|
||||
// add_topic("estimator_status");
|
||||
add_topic("vehicle_status", 100);
|
||||
|
||||
_writer_thread = _writer.thread_start();
|
||||
int ret = _writer.thread_start(_writer_thread);
|
||||
|
||||
if (ret) {
|
||||
PX4_ERR("logger: failed to create writer thread (%i)", ret);
|
||||
return;
|
||||
}
|
||||
|
||||
_task_should_exit = false;
|
||||
|
||||
@@ -584,7 +589,7 @@ void Logger::run()
|
||||
_writer.notify();
|
||||
|
||||
// wait for thread to complete
|
||||
int ret = pthread_join(_writer_thread, NULL);
|
||||
ret = pthread_join(_writer_thread, NULL);
|
||||
|
||||
if (ret) {
|
||||
PX4_WARN("join failed: %d", ret);
|
||||
|
||||
Reference in new issue
Block a user