calling MainMenuAction() from an other plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Udo Richter wrote:

>>> if (ShowMessage && !Skins.IsOpen() && !cOsd::IsOpen()) {
>>>    ShowMessage = false;
>>>    cRemote::CallPlugin("myShowMessage");
>>>    }
>>
>> this looks racy to me. What if two different threads do this?
>> The OSD could open between the if () and ::CallPlugin
> 
> CallPlugin is always racy, as only one plugin call will be remembered.
> 
> The only safe way is to set up a signal and wait for MainMenuAction 
> being called. If it is not called within timeout, try again.
> 
> The IsOpen() calls should ideally be made from foreground thread, but 
> usually there's no way to get there. Testing from within MainMenuAction 
> is pointless, as OSD and menu get closed right before MainMenuAction.

I did something similar in my vdr-xine plugin. Things could be improved 
using the attached patch.

It allows to remember up to 16 calls to different plugins and the caller 
can detect, whether putting the call in the remote key fifo was successful.

Bye.
-- 
Dipl.-Inform. (FH) Reinhard Nissl
mailto:rnissl@xxxxxx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vdr-1.3.44-remote.patch
Type: text/x-patch
Size: 2201 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/vdr/attachments/20060328/2f2dc82c/vdr-1.3.44-remote.bin

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux