120 sub _openFDCObject 121 { 122 my $self = shift; 123 my $swObject = shift; 124 my $switch = shift; 125 my $fdcObject = FosDataCapture->new($log, $swObject); 126 return ($fdcObject, $switch); 127 } 128 129 sub getFDCObjects 130 { 131 my $self = shift; 132 my %fdcObjectHash; 133 my @threadQueue; 134 my %switches = $self->getSwitches(); 135 for my $switch (keys %switches) 136 { 137 #my $fdcObject = $self->_openFDCObject($switches{$switch}, $switch); 138 my $swObject = $switches{$switch}; 139 my $thread = threads->create(\$self->_openFDCObject($swObject,$switch)); 140 push(@threadQueue, $thread); 141 #$fdcObjectHash{$switch} = $fdcObject; 142 } 143 foreach my $thread (@threadQueue) 144 { 145 my ($fdcObject, $switch); 146 ($fdcObject, $switch) = $thread->join(); 147 $fdcObjectHash{$switch} = $fdcObject; 148 } 149 return %fdcObjectHash; #### my $thread = threads->create(\$self->_openFDCObject($swObject,$switch)); my $thread = threads->create(\$self->_openFDCObject,$swObject,$switch); my $thread = threads->create($self->_openFDCObject,$swObject,$switch); my $thread = threads->create(&_openFDCObject,$swObject,$switch);