refactor logger: use static fields & move them to source file

avoids multiple declarations of...
This commit is contained in:
Beat Küng
2016-05-24 14:17:04 +02:00
committed by Lorenz Meier
parent 43d734ef43
commit 659ac8faf2
2 changed files with 9 additions and 8 deletions
+6 -2
View File
@@ -75,6 +75,10 @@
using namespace px4::logger;
static Logger *logger_ptr = nullptr;
static int logger_task = -1;
static pthread_t writer_thread;
int logger_main(int argc, char *argv[])
{
// logger currently assumes little endian
@@ -464,7 +468,7 @@ void Logger::run()
return;
}
int ret = _writer.thread_start(_writer_thread);
int ret = _writer.thread_start(writer_thread);
if (ret) {
PX4_ERR("logger: failed to create writer thread (%i)", ret);
@@ -616,7 +620,7 @@ void Logger::run()
_writer.notify();
// wait for thread to complete
ret = pthread_join(_writer_thread, NULL);
ret = pthread_join(writer_thread, NULL);
if (ret) {
PX4_WARN("join failed: %d", ret);