Centralized 'thread active' handling

Message ID 42FE1BA4.4080205@syphir.sytes.net
State New
Headers

Commit Message

C.Y.M Aug. 13, 2005, 4:11 p.m. UTC
  C.Y.M wrote:
>>Now, with the naming problem settled, are there any actual, technical
>>issues with this modification?
>>
> 
> 
> A quick compile test (using the patch in this thread) and all my plugins build
> except for autotimeredit-0.1.6:
> 
> g++ -g -O2 -Wall -Woverloaded-virtual -c -DPLUGIN_NAME_I18N='"autotimeredit"'
> -D_GNU_SOURCE -I../../../include -I/usr/src/DVB/linux/include autotimeredit.c
> autotimeredit.c: In member function `virtual void cPluginAutoTimer::Housekeeping()':
> ../../../include/vdr/thread.h:94: error: `bool cThread::Active()' is protected
> autotimeredit.c:948: error: within this context
> make[1]: *** [autotimeredit.o] Error 1
> 

The attached patch is compile tested.

Regards,
  

Patch

diff -ruN vdr-1.3.28-eepg-orig/PLUGINS/src/autotimeredit/autotimeredit.c vdr-1.3.28-eepg/PLUGINS/src/autotimeredit/autotimeredit.c
--- vdr-1.3.28-eepg-orig/PLUGINS/src/autotimeredit/autotimeredit.c	2005-04-05 10:26:10.000000000 -0700
+++ vdr-1.3.28-eepg/PLUGINS/src/autotimeredit/autotimeredit.c	2005-08-13 08:57:51.000000000 -0700
@@ -945,7 +945,7 @@ 
   dsyslog("%s: cPluginAutoTimer::Housekeeping UpdateThread-Active=%s UpdateThread-PID=%d", plugin_name, oUpdateThread ? oUpdateThread->Active() ? "true" : "false" : "(null)", oUpdateThread ? oUpdateThread->PID() : -1);
 #endif
   if (oUpdateThread)
-    if (oUpdateThread->Active())
+    if (oUpdateThread->Running())
     {
       if (time(NULL) > oUpdateThread->StartTime() + 240 )
       {
diff -ruN vdr-1.3.28-eepg-orig/PLUGINS/src/autotimeredit/autotimers.c vdr-1.3.28-eepg/PLUGINS/src/autotimeredit/autotimers.c
--- vdr-1.3.28-eepg-orig/PLUGINS/src/autotimeredit/autotimers.c	2005-04-05 01:02:06.000000000 -0700
+++ vdr-1.3.28-eepg/PLUGINS/src/autotimeredit/autotimers.c	2005-08-13 09:02:31.000000000 -0700
@@ -417,7 +417,7 @@ 
   dsyslog("%s: cAutoTimers::RunUpdate updatemethod=%d", plugin_name, updatemethod.u);
 #endif
   char * cmd = NULL;
-  if (oUpdateThread && oUpdateThread->Active())
+  if (oUpdateThread && oUpdateThread->Running())
   {
     ERROR(tr("Error$search update is runing"));
     return false;