Changeset 11050
- Timestamp:
- 03/10/10 14:55:56 (2 years ago)
- File:
-
- 1 edited
-
trunk/Padre/lib/Padre/TaskManager.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Padre/lib/Padre/TaskManager.pm
r11040 r11050 426 426 my @workers = $self->workers; 427 427 $self->task_queue->insert( 0, ("STOP") x scalar(@workers) ); 428 while ( threads->list(threads::running) >= 2 ) { 429 $_->join for threads->list(threads::joinable); 430 } 428 429 my $loopcount; 430 # Changing the selection seems to solve the endless-loop problem 431 # while ( threads->list(threads::running) >= 2 ) { 432 while ( threads->list(threads::joinable) >= 2 ) { 433 for (threads->list(threads::joinable)) { 434 $_->join; 435 } 436 last if $loopcount > 125; # Wait no more than two minutes 437 # Pass time slices to the threads for finishing 438 sleep 1 if ++$loopcount > 5; 439 } 440 431 441 foreach my $thread ( threads->list(threads::joinable) ) { 432 442 TRACE( 'Joining thread ' . $thread->tid ) if DEBUG;
Note: See TracChangeset
for help on using the changeset viewer.
