diff options
author | lordjaxom <lordjaxom> | 2004-10-27 18:08:03 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-10-27 18:08:03 +0000 |
commit | eb2f2c9600e8f69788232582191b141002bcd522 (patch) | |
tree | 4510197a5afd5e657e42421eb96820134e916c6b /render.c | |
parent | 5071a1754f3db0adcf477ecf8e5b2a818d1935bd (diff) | |
download | vdr-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
Diffstat (limited to 'render.c')
-rw-r--r-- | render.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |