diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2006-04-09 11:28:59 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2006-04-09 11:28:59 +0200 |
commit | 56d49abc22f61b5343f2e99fa1511508cf1d7aba (patch) | |
tree | 15341205649860a22e66c69beb737ad782108d13 /skins.c | |
parent | 2cd5bf83fb53642aaaee76dc8a80a3e4a6260339 (diff) | |
download | vdr-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.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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; |