[Fusioninventory-commit] [fusinv/fusioninventory-agent-task-netdiscovery] 813a34: lock shared results list when accessing it

Guillaume Rousse guillomovitch at gmail.com
Wed Apr 25 07:24:14 UTC 2012


  Branch: refs/heads/master
  Home:   https://github.com/fusinv/fusioninventory-agent-task-netdiscovery
  Commit: 813a34789e24e548706295e7252a317821697861
      https://github.com/fusinv/fusioninventory-agent-task-netdiscovery/commit/813a34789e24e548706295e7252a317821697861
  Author: Guillaume Rousse <guillomovitch at gmail.com>
  Date:   2012-04-25 (Wed, 25 Apr 2012)

  Changed paths:
    M lib/FusionInventory/Agent/Task/NetDiscovery.pm

  Log Message:
  -----------
  lock shared results list when accessing it


diff --git a/lib/FusionInventory/Agent/Task/NetDiscovery.pm b/lib/FusionInventory/Agent/Task/NetDiscovery.pm
index 3cf6425..fbc0973 100644
--- a/lib/FusionInventory/Agent/Task/NetDiscovery.pm
+++ b/lib/FusionInventory/Agent/Task/NetDiscovery.pm
@@ -260,7 +260,7 @@ sub run {
             delay(1);
 
             # send results to the server
-            while (my $result = shift @results) {
+            while (my $result = do { lock @results; shift @results; }) {
                 my $data = {
                     DEVICE        => [$result],
                     MODULEVERSION => $VERSION,


================================================================



More information about the Fusioninventory-commit mailing list