Re: Threaded Gtk2->main causing seg fault



package main;
use Gtk2 '-init';
use threads;
use threads::shared;

my $base = Base->new ();
share ($base);


erm, that's not really supported.  quoting threads::shared:

   BUGS
"bless" is not supported on shared references. In the current version,
       "bless" will only bless the thread local reference and the blessing
will not propagate to the other threads. This is expected to be imple-
       mented in a future version of Perl.

so, i admit i'm actually surprised that it works at all.


I read the bug as "compile time bless would not work, since bless reference does not exist before running". Changing the code to

my $base : shared = Base->new ();

would not work at all. I am new to perl, correct me if I am wrong.

Kevin Leung




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