mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
If cSkins::Message() is called from a background thread and Type is not mtStatus, the call is now automatically forwarded to QueueMessage()
This commit is contained in:
parent
712523f004
commit
0873d14614
2
HISTORY
2
HISTORY
@ -9415,3 +9415,5 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed inconsistent behavior in case only certain devices are used (selected by the '-D'
|
- Fixed inconsistent behavior in case only certain devices are used (selected by the '-D'
|
||||||
option).
|
option).
|
||||||
- Fixed a wrong variable name in cFileName::cFileName().
|
- Fixed a wrong variable name in cFileName::cFileName().
|
||||||
|
- If cSkins::Message() is called from a background thread and Type is not mtStatus,
|
||||||
|
the call is now automatically forwarded to QueueMessage().
|
||||||
|
7
skins.c
7
skins.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: skins.c 4.1 2018/04/28 12:13:01 kls Exp $
|
* $Id: skins.c 4.2 2019/05/29 16:43:09 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "skins.h"
|
#include "skins.h"
|
||||||
@ -250,7 +250,10 @@ bool cSkins::SetCurrent(const char *Name)
|
|||||||
eKeys cSkins::Message(eMessageType Type, const char *s, int Seconds)
|
eKeys cSkins::Message(eMessageType Type, const char *s, int Seconds)
|
||||||
{
|
{
|
||||||
if (!cThread::IsMainThread()) {
|
if (!cThread::IsMainThread()) {
|
||||||
dsyslog("cSkins::Message() called from background thread - ignored! (Use cSkins::QueueMessage() instead)");
|
if (Type != mtStatus)
|
||||||
|
QueueMessage(Type, s, Seconds);
|
||||||
|
else
|
||||||
|
dsyslog("cSkins::Message(%d, \"%s\", %d) called from background thread - ignored! (Use cSkins::QueueMessage() instead)", Type, s, Seconds);
|
||||||
return kNone;
|
return kNone;
|
||||||
}
|
}
|
||||||
switch (Type) {
|
switch (Type) {
|
||||||
|
4
skins.h
4
skins.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: skins.h 4.5 2017/11/02 15:04:56 kls Exp $
|
* $Id: skins.h 4.6 2019/05/29 16:36:41 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __SKINS_H
|
#ifndef __SKINS_H
|
||||||
@ -477,6 +477,8 @@ public:
|
|||||||
///< has been received within Seconds (the default value of 0 results
|
///< has been received within Seconds (the default value of 0 results
|
||||||
///< in the value defined for "Message time" in the setup), kNone
|
///< in the value defined for "Message time" in the setup), kNone
|
||||||
///< will be returned.
|
///< will be returned.
|
||||||
|
///< If Message() is called from a background thread and Type is not
|
||||||
|
///< mtStatus, the call will be automatically forwarded to QueueMessage().
|
||||||
int QueueMessage(eMessageType Type, const char *s, int Seconds = 0, int Timeout = 0);
|
int QueueMessage(eMessageType Type, const char *s, int Seconds = 0, int Timeout = 0);
|
||||||
///< Like Message(), but this function may be called from a background
|
///< Like Message(), but this function may be called from a background
|
||||||
///< thread. The given message is put into a queue and the main program
|
///< thread. The given message is put into a queue and the main program
|
||||||
|
Loading…
Reference in New Issue
Block a user