The new function cPlugin::MainThreadHook() can be used by plugins to perform actions in the context of the main program thread

This commit is contained in:
Klaus Schmidinger
2006-04-17 10:02:18 +02:00
parent acf716f1ef
commit 8433190d5a
6 changed files with 53 additions and 4 deletions

View File

@@ -63,6 +63,7 @@ structures and allows it to hook itself into specific areas to perform special a
<li><a href="#User interaction">User interaction</a>
<li><a href="#Housekeeping">Housekeeping</a>
<!--X1.3.47--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<li><a href="#Main thread hook">Main thread hook</a>
<li><a href="#Activity">Activity</a>
<!--X1.3.47--></td></tr></table>
<li><a href="#Setup parameters">Setup parameters</a>
@@ -620,6 +621,27 @@ the plugin should launch a separate thread to do this.
</b>
<!--X1.3.47--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<a name="Main thread hook"><hr><h2>Main thread hook</h2>
<center><i><b>Pushing in...</b></i></center><p>
Normally a plugin only reacts on user input if directly called through its
<a href="#Main menu entry">main menu entry</a>, or performs some background
activity in a separate thread. However, sometimes a plugin may need to do
something in the context of the main program thread, without being explicitly
called up by the user. In such a case it can implement the function
<p><table><tr><td bgcolor=#F0F0F0><pre>
virtual void MainThreadHook(void);
</pre></td></tr></table><p>
in which it can do this. This function is called for every plugin once during
every cycle of VDR's main program loop, which typically happens once every
second.
<b>Be very careful when using this function, and make sure you return from it
as soon as possible! If you spend too much time in this function, the user
interface performance will become sluggish!</b>
<a name="Activity"><hr><h2>Activity</h2>
<center><i><b>Now is not a good time!</b></i></center><p>