in reply to stopping a thread in wxPerl?
... maybe $event->dequeue is hanging? ..... maybe experiment there with a counter and see how many times it prints STOP and figure out why it dosn't return ?while (my $message = $event->dequeue ) { print "IN HERE\n"; return 1 if $message eq 'STOP';
... maybe try a time delay to give the eventloop enough loop time to get it all done?
in other words find the best Wx way to wait there for the thread to return$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 }
|
|---|