I'm not sure I understand your code, but why not just arrange for $taxis->taxis to immediately return if another instance is already running?
Of course, this must be modified if $taxis->taxis is recursive.my $RUNNING = 0; $mw->repeat( 50 => sub { $taxis->taxis(\$RUNNING) unless $RUNNING} ]; MainLoop; package taxis; sub taxis { my ($self, $r_running, @whatever, ) = @_; $mw->update; $$r_running = 1; # do other stuff that takes a while $$r_running = 0; return; }
....I think.....sub taxis { my ($self, $r_running, @whatever, ) = @_; $mw->update; $$r_running = 1; # other stuff my $null = 0; $self->taxis(\$null, $whatever); $$r_running = 0; return; }
--Bob Niederman, http://bob-n.com
All code given here is UNTESTED unless otherwise stated.
In reply to Re: Deep recursion in Tk repeat
by bobn
in thread Deep recursion in Tk repeat
by polypompholyx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |