mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
logger: proper error handling if writer thread creation fails
This commit is contained in:
@@ -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