logger: move thread start/stop logic into LogWriterFile

This commit is contained in:
Beat Küng
2016-10-07 17:07:37 +02:00
committed by Lorenz Meier
parent 78f19fccce
commit 1ddddccb81
5 changed files with 25 additions and 39 deletions
+1 -19
View File
@@ -635,16 +635,7 @@ void Logger::run()
if (!_writer.init()) {
PX4_ERR("init of writer failed (alloc failed)");
return;
}
pthread_t writer_thread;
int ret = _writer.thread_start(writer_thread);
if (ret) {
PX4_ERR("failed to create writer thread (%i)", ret);
PX4_ERR("writer init failed");
return;
}
@@ -814,15 +805,6 @@ void Logger::run()
// stop the writer thread
_writer.thread_stop();
_writer.notify();
// wait for thread to complete
ret = pthread_join(writer_thread, NULL);
if (ret) {
PX4_WARN("join failed: %d", ret);
}
//unsubscribe
for (LoggerSubscription &sub : _subscriptions) {
for (uint8_t instance = 0; instance < ORB_MULTI_MAX_INSTANCES; instance++) {