Updating menu items from separate thread

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

 



Udo Richter wrote:

> I don't think that updating menus from other threads is allowed by design.


Surly not, I just thought, there might be an easy way to make this
thread safe.

> My suggestion is to take a look on how the dynamic updating recordings
> menu works in vdr-1.3.33 and newer. Basically, a background thread
> collects the data, and the foreground thread updates the menu on the
> next ProcessKey(kNone) call.


Ok, I see - I already thought about this. It just didn't felt right,
because I see ProcessKey() as some kind of message loop, which I don't
want to give too much responsibilities. In my current design, the menu
has a presenter (MVP), which is an observer that get's notified by the
thread. I will probably let the presenter collect the items to be
updated and when the menu comes across a kNone in ProcessKey, it lets
the presenter update any items it may have in it's "update queue".
Surely not the best solution, but maybe I will find a better one later on.

Thanks,

Tobias




[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