in reply to threads problem
use strict; use warnings; use threads; mxu_install(); sub mxu_install { my $count=0; my $kit_temp=$ARGV[0]; if(!opendir(MXU_DIR,"$kit_temp/MXU")) { print "Can't open $kit_temp/MXU: $!"; } while( defined (my $file = readdir MXU_DIR) ) { next if $file =~ /^\.\.?$/; } closedir(MXU_DIR); install_mxu_comp(); return; } sub install_mxu_comp { my $count=0; $|=1; my $thread1 = threads->new(\&blah); my $thread2=threads->new(\&blah); $thread1->join(); $thread2->join(); print "Father exiting\n"; return 0; } sub blah { print "inthread\n"; sleep(5); }
|
|---|