diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 61c999b72d..4fcbfd9132 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,8 @@ +2011-02-03 Ramon Novoa + + * win32/installer/pandora.mpi, win32/pandora.cc, unix/pandora_agent: Free + the threads semaphore when a module or plugin does not execute. + 2011-02-01 Sergio Martin * android/AndroidManifest.xml diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 7d04948d06..073f60af3a 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -818,13 +818,22 @@ sub exec_module ($) { my $module = shift; # Need something to execute - return unless ($module->{'func'} != 0); + if ($module->{'func'} == 0) { + $ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1); + return; + } # Check module interval - return unless (++($module->{'counter'}) >= $module->{'interval'}); + if (++($module->{'counter'}) < $module->{'interval'}) { + $ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1); + return; + } # Check module cron - return unless (check_module_cron ($module) == 1); + if (check_module_cron ($module) != 1) { + $ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1); + return; + } # Reset module counter $module->{'counter'} = 0; @@ -1273,7 +1282,10 @@ sub exec_plugin ($) { my $output = `$plugin 2>$DevNull`; # Do not save the output if there was an error - return unless ($? eq 0); + if ($? != 0) { + $ThreadSem->up () if (defined ($ThreadSem) && $Conf{'agent_threads'} > 1); + return; + } # Critical section $Sem->down () if (defined ($Sem)); diff --git a/pandora_agents/win32/installer/pandora.mpi b/pandora_agents/win32/installer/pandora.mpi index cda9dbb87c..7bd59b223d 100755 --- a/pandora_agents/win32/installer/pandora.mpi +++ b/pandora_agents/win32/installer/pandora.mpi @@ -186,7 +186,7 @@ UpgradeApplicationID {} Version -{101227} +{101228} ViewReadme {Yes} diff --git a/pandora_agents/win32/pandora.cc b/pandora_agents/win32/pandora.cc index 356cb8ca73..370a785b93 100644 --- a/pandora_agents/win32/pandora.cc +++ b/pandora_agents/win32/pandora.cc @@ -30,7 +30,7 @@ using namespace Pandora; using namespace Pandora_Strutils; #define PATH_SIZE _MAX_PATH+1 -#define PANDORA_VERSION ("3.2(Build 101227)") +#define PANDORA_VERSION ("3.2(Build 101228)") string pandora_path; string pandora_dir;