diff options
author | lordjaxom <lordjaxom> | 2005-06-03 08:53:13 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2005-06-03 08:53:13 +0000 |
commit | c8187fca32a6f0ff69eff09a83011e9ce45a20f6 (patch) | |
tree | ad3e76717681a5b94863b93851f494a3df935e21 /status.c | |
parent | 7ce72d9d02dde33576a85227fe396a3f07ebac0d (diff) | |
download | vdr-plugin-text2skin-c8187fca32a6f0ff69eff09a83011e9ce45a20f6.tar.gz vdr-plugin-text2skin-c8187fca32a6f0ff69eff09a83011e9ce45a20f6.tar.bz2 |
- protected access to recordings list with a mutex
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* - * $Id: status.c,v 1.9 2005/01/31 14:40:55 lordjaxom Exp $ + * $Id: status.c,v 1.10 2005/06/03 08:53:13 lordjaxom Exp $ */ #include "status.h" @@ -88,12 +88,14 @@ void cText2SkinStatus::Recording(const cDevice *Device, const char *Name) if (mRender != NULL) mRender->UpdateLock(); + mRecordingsLock.Lock(); mRecordings.clear(); cTimer *t = Timers.First(); for (; t != NULL; t = Timers.Next(t)) { if (t->Recording()) mRecordings.push_back(t->File()); } + mRecordingsLock.Unlock(); if (mRender != NULL) { Dprintf("\nFlushing from cStatus\n\n"); @@ -123,6 +125,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) ? (cxType)mRecordings[Token.Attrib.Number] : (cxType)false; } else if (mRecordings.size() > 0) { + mRecordingsLock.Lock(); uint now = time_ms(); if (mNextRecording == 0) mNextRecording = now + 2000; @@ -138,6 +141,7 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) } cxType res = mRecordings[mCurrentRecording]; + mRecordingsLock.Unlock(); res.SetUpdate(next); return res; } |