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 | |
parent | 7ce72d9d02dde33576a85227fe396a3f07ebac0d (diff) | |
download | vdr-plugin-text2skin-c8187fca32a6f0ff69eff09a83011e9ce45a20f6.tar.gz vdr-plugin-text2skin-c8187fca32a6f0ff69eff09a83011e9ce45a20f6.tar.bz2 |
- protected access to recordings list with a mutex
-rw-r--r-- | status.c | 6 | ||||
-rw-r--r-- | status.h | 3 |
2 files changed, 7 insertions, 2 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; } @@ -1,5 +1,5 @@ /* - * $Id: status.h,v 1.6 2005/01/25 15:15:53 lordjaxom Exp $ + * $Id: status.h,v 1.7 2005/06/03 08:53:13 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_STATUS_H @@ -33,6 +33,7 @@ private: bool mReplayIsLoop; bool mReplayIsShuffle; tRecordings mRecordings; + cMutex mRecordingsLock; uint mCurrentRecording; uint mNextRecording; int mLastLanguage; |