Re: Threads and Gtk2



Even when the variable is shared, I get the same behavior:

 my $keep_running : shared = 1;

I think it has to do with the callback, is there some way to have a
callback not make a copy of it's own vars?

Thanks, Javier

On 10/19/05, muppet <scott asofyet org> wrote:

Javier Godinez said:
Is there a way to gracefully stop a thread from a Gtk2 callback by
using a global?
I am not sure how to get out of the running thread as shown here:

#############################
#!/usr/bin/perl -w

use Gtk2 '-init';
use strict;
use threads;

my $keep_running = 1;

You didn't mark this variable as shared, so the two threads see different values.




--
muppet <scott at asofyet dot org>





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]