summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-10-27 18:08:03 +0000
committerlordjaxom <lordjaxom>2004-10-27 18:08:03 +0000
commiteb2f2c9600e8f69788232582191b141002bcd522 (patch)
tree4510197a5afd5e657e42421eb96820134e916c6b
parent5071a1754f3db0adcf477ecf8e5b2a818d1935bd (diff)
downloadvdr-plugin-text2skin-eb2f2c9600e8f69788232582191b141002bcd522.tar.gz
vdr-plugin-text2skin-eb2f2c9600e8f69788232582191b141002bcd522.tar.bz2
- fixed ugly race conditions that appears to occur more often with VDR >= 1.3.14v0.0.8.1
-rw-r--r--HISTORY4
-rw-r--r--display.c2
-rw-r--r--render.c10
-rw-r--r--render.h1
-rw-r--r--screen.c1
-rw-r--r--text2skin.c2
6 files changed, 19 insertions, 1 deletions
diff --git a/HISTORY b/HISTORY
index ca50bc6..0f1e925 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,10 @@
VDR Plugin 'text2skin' Revision History
---------------------------------------
+2004-07-27: Version 0.0.8.1
+
+- fixed ugly race conditions that appears to occur more often with VDR >= 1.3.14
+
2004-07-14: Version 0.0.8
- fixed display of scrollbar if there is no text present
diff --git a/display.c b/display.c
index efb875b..e2cdbc8 100644
--- a/display.c
+++ b/display.c
@@ -53,7 +53,9 @@ void cText2SkinDisplayChannel::SetMessage(eMessageType Type, const char *Text) {
void cText2SkinDisplayChannel::Flush(void) {
if (mDirty) {
+ Dprintf("Flushing\n");
mRender->Flush();
+ Dprintf("Flushing done\n");
mDirty = false;
}
}
diff --git a/render.c b/render.c
index 8d216f1..02b97a0 100644
--- a/render.c
+++ b/render.c
@@ -90,6 +90,7 @@ cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, eSkinSection Sectio
}
}
res = mScreen->SetAreas(areas, numAreas);
+ Dprintf("areas set, res = %d\n", res);
if (res != oeOk) {
const char *emsg = NULL;
@@ -113,7 +114,12 @@ cText2SkinRender::cText2SkinRender(cText2SkinLoader *Loader, eSkinSection Sectio
}
esyslog("ERROR: text2skin: OSD provider can't handle skin: %s\n", emsg);
}
+
+ Lock();
Start();
+ mStarted.Wait(mMutex);
+ Unlock();
+ // Make sure this constructor returns when the thread is running
}
cText2SkinRender::~cText2SkinRender() {
@@ -131,9 +137,13 @@ cText2SkinRender::~cText2SkinRender() {
void cText2SkinRender::Action(void) {
mActive = true;
Lock();
+ mStarted.Broadcast(); // signal the constructor
while (mActive) {
+ Dprintf("mutex locked? %d\n", mMutex.locked);
+ int b = time_ms();
if (mUpdateIn) mDoUpdate.TimedWait(mMutex, mUpdateIn);
else mDoUpdate.Wait(mMutex);
+ Dprintf("waited %d\n", time_ms() - b);
if (!mActive) break; // fall out if thread to be stopped
diff --git a/render.h b/render.h
index 1c20beb..7057315 100644
--- a/render.h
+++ b/render.h
@@ -91,6 +91,7 @@ private:
// update thread
bool mActive;
cCondVar mDoUpdate;
+ cCondVar mStarted;
cMutex mMutex;
int mUpdateIn;
diff --git a/screen.c b/screen.c
index 16f5418..3b85515 100644
--- a/screen.c
+++ b/screen.c
@@ -6,6 +6,7 @@
cText2SkinScreen::cText2SkinScreen(int x, int y) {
mOsd = cOsdProvider::NewOsd(x, y);
+ Dprintf("got osd -> %p\n", mOsd);
}
cText2SkinScreen::~cText2SkinScreen() {
diff --git a/text2skin.c b/text2skin.c
index 6ef67e3..f014c9e 100644
--- a/text2skin.c
+++ b/text2skin.c
@@ -11,7 +11,7 @@
#include "i18n.h"
#include "loader.h"
-const char *cText2SkinPlugin::VERSION = "0.0.8";
+const char *cText2SkinPlugin::VERSION = "0.0.8.1";
const char *cText2SkinPlugin::THEMEVERSION = "0.0.3";
const char *cText2SkinPlugin::DESCRIPTION = "Loader for text-based skins";