summaryrefslogtreecommitdiff
path: root/skins.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-04-09 11:28:59 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2006-04-09 11:28:59 +0200
commit56d49abc22f61b5343f2e99fa1511508cf1d7aba (patch)
tree15341205649860a22e66c69beb737ad782108d13 /skins.c
parent2cd5bf83fb53642aaaee76dc8a80a3e4a6260339 (diff)
downloadvdr-56d49abc22f61b5343f2e99fa1511508cf1d7aba.tar.gz
vdr-56d49abc22f61b5343f2e99fa1511508cf1d7aba.tar.bz2
cSkins::QueueMessage() called from a background thread with an empty message now clears all messages that have been previously queued by that thread
Diffstat (limited to 'skins.c')
-rw-r--r--skins.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/skins.c b/skins.c
index 0952b118..736d7dad 100644
--- a/skins.c
+++ b/skins.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skins.c 1.8 2006/02/05 14:53:04 kls Exp $
+ * $Id: skins.c 1.9 2006/04/09 11:25:30 kls Exp $
*/
#include "skins.h"
@@ -255,7 +255,16 @@ int cSkins::QueueMessage(eMessageType Type, const char *s, int Seconds, int Time
return kNone;
}
if (isempty(s)) {
- dsyslog("cSkins::QueueMessage() called with empty message - ignored!");
+ if (!cThread::IsMainThread()) {
+ queueMessageMutex.Lock();
+ for (cSkinQueuedMessage *m = SkinQueuedMessages.Last(); m; m = SkinQueuedMessages.Prev(m)) {
+ if (m->threadId == cThread::ThreadId() && m->state == 0)
+ m->state = 2; // done
+ }
+ queueMessageMutex.Unlock();
+ }
+ else
+ dsyslog("cSkins::QueueMessage() called with empty message from main thread - ignored!");
return kNone;
}
int k = kNone;