[vdr] calling MainMenuAction() from an other plugin

Udo Richter udo_richter at gmx.de
Tue Mar 28 16:30:45 CEST 2006


Wolfgang Rohdewald wrote:
> On Tuesday 28 March 2006 12:20, Uwe Hanke 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.

Cheers,

Udo



More information about the vdr mailing list