while (my $message = $event->dequeue ) { print "IN HERE\n"; return 1 if $message eq 'STOP'; #### $self->{queue}->enqueue('STOP'); # insert a small Wx time delay here, or use a conditional in the join like: do 1 until $self->{worker}->join; #or code to wait for the thread count to change }