calling MainMenuAction() from an other plugin

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

 



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


[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