Changeset 360
- Timestamp:
- 05/24/07 17:00:15 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/kindlund-filesystem/lib/HoneyClient/Agent.pm
r352 r360 682 682 } else { 683 683 print "Thread is NOT running.\n"; 684 print "Joining dead thread...\n"; 685 # XXX: Check to see if this works. 686 threads->object($tid)->join(); 687 print "Finished dead thread join!\n"; 684 688 } 685 689 } else { … … 802 806 $data->{$driverName}->{'state'} = $driver; 803 807 804 if ($driver->isFinished()) { 805 # Thread is about to finish, set the ID back to undef. 806 # This looks ugly, but setting it this early avoids the 807 # potential race condition of when the run() thread is finished 808 # and when updateState() checks for $driverData->{$driverName}->{'thread_id'} 809 # to be set to undef. 810 $data->{$driverName}->{'thread_id'} = undef; 811 } 808 # XXX: Check to see if this is okay. 809 # if ($driver->isFinished()) { 810 # # Thread is about to finish, set the ID back to undef. 811 # # This looks ugly, but setting it this early avoids the 812 # # potential race condition of when the run() thread is finished 813 # # and when updateState() checks for $driverData->{$driverName}->{'thread_id'} 814 # # to be set to undef. 815 # $data->{$driverName}->{'thread_id'} = undef; 816 # } 812 817 813 818 # Release lock on stored driver state. … … 895 900 896 901 # Thread is about to finish, set the ID back to undef. 897 $data->{$driverName}->{'thread_id'} = undef; 902 # XXX: Check to see if this is okay. 903 # $data->{$driverName}->{'thread_id'} = undef; 898 904 899 905 # Release lock on stored driver state. … … 929 935 930 936 # Make sure we update our state to reflect ourself dying. 931 $data->{$driverName}->{'thread_id'} = undef; 937 # XXX: Check to see if this is okay. 938 # $data->{$driverName}->{'thread_id'} = undef; 932 939 933 940 # Release lock on stored driver state. … … 952 959 953 960 # Set the valid thread ID. 961 $data->{$driverName}->{'thread_id'} = $thread->tid(); 954 962 if ($thread->is_running()) { 955 963 # XXX: Debugging, remove eventually. 956 964 print "Thread ID = " . $thread->tid() . "\n"; 957 $data->{$driverName}->{'thread_id'} = $thread->tid();965 #$data->{$driverName}->{'thread_id'} = $thread->tid(); 958 966 } else { 959 967 # XXX: Debugging, remove eventually. 960 print "Thread ID = undef\n"; 961 $data->{$driverName}->{'thread_id'} = undef; 968 print "Thread ID = " . $thread->tid() . " (NOT RUNNING)\n"; 969 #print "Thread ID = undef\n"; 970 #$data->{$driverName}->{'thread_id'} = undef; 962 971 } 963 972
