From 89ab7c86dc82c3c1132b527e73ce5a9a2c224643 Mon Sep 17 00:00:00 2001 From: max_10 Date: Thu, 20 Sep 2018 16:58:06 +0200 Subject: [PATCH] Revert "changed raspi to own thread class" This reverts commit 467f6976f78bce47bf5eb310999535e3765366b6. --- raspi/Makefile.am | 3 ++- raspi/glfb.cpp | 10 +++++----- raspi/glfb.h | 6 +++--- raspi/init.cpp | 8 ++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/raspi/Makefile.am b/raspi/Makefile.am index 3bc2d31..32cd87a 100644 --- a/raspi/Makefile.am +++ b/raspi/Makefile.am @@ -10,7 +10,8 @@ AM_CPPFLAGS += \ AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing AM_LDFLAGS = \ - -L/opt/vc/lib/ -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt + -L/opt/vc/lib/ -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt \ + -lOpenThreads libraspi_la_SOURCES = \ hardware_caps.c \ diff --git a/raspi/glfb.cpp b/raspi/glfb.cpp index 764afa9..45d6473 100644 --- a/raspi/glfb.cpp +++ b/raspi/glfb.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include "glfb.h" #include "bcm_host.h" @@ -47,8 +47,8 @@ static int curr_res; static int pitch; static VC_IMAGE_TYPE_T type = VC_IMAGE_ARGB8888; -static Mutex blit_mutex; -static Condition blit_cond; +static OpenThreads::Mutex blit_mutex; +static OpenThreads::Condition blit_cond; static bool goodbye = false; /* if set main loop is left */ static bool ready = false; /* condition predicate */ @@ -71,7 +71,7 @@ GLFramebuffer::GLFramebuffer(int x, int y) si.red.offset = 16; si.transp.offset = 24; - Thread::start(); + OpenThreads::Thread::start(); while (!ready) usleep(1); } @@ -80,7 +80,7 @@ GLFramebuffer::~GLFramebuffer() { goodbye = true; blit(); /* wake up thread */ - Thread::join(); + OpenThreads::Thread::join(); } void GLFramebuffer::run() diff --git a/raspi/glfb.h b/raspi/glfb.h index 68e2055..c5fcce6 100644 --- a/raspi/glfb.h +++ b/raspi/glfb.h @@ -17,11 +17,11 @@ #ifndef __glthread__ #define __glthread__ -#include +#include #include #include /* for screeninfo etc. */ -class GLFramebuffer : public Thread +class GLFramebuffer : public OpenThreads::Thread { public: GLFramebuffer(int x, int y); @@ -34,7 +34,7 @@ private: void *pdata; /* not yet used */ fb_var_screeninfo si; std::vector osd_buf; /* silly bounce buffer */ - void run(); /* for Thread */ + void run(); /* for OpenThreads::Thread */ void setup(); void blit_osd(); diff --git a/raspi/init.cpp b/raspi/init.cpp index 6e6adfc..47f6d9e 100644 --- a/raspi/init.cpp +++ b/raspi/init.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include "init_td.h" #include "lt_debug.h" @@ -69,7 +69,7 @@ static void init_keymap(void) kmap[KEY_F8] = KEY_SLEEP; } -class Input: public Thread +class Input: public OpenThreads::Thread { public: Input(); @@ -82,13 +82,13 @@ class Input: public Thread Input::Input() { Init(); - Thread::start(); + start(); } Input::~Input() { running = false; - Thread::join(); + join(); } static int dirfilter(const struct dirent *d)