
miniCruzer
Novice
Nov 28, 2010, 12:23 PM
Post #1 of 1
(587 views)
|
I'm playing around with threads, and I can't get them to behave like I want them to. Here's the old code:
# snip $commands{lc($parv[0])}{code}->($target->[0], $nick, $args) if $args; $commands{lc($parv[0])}{code}->($target->[0], $nick) if !$args; # snip New Code:
# snip my $thread = threads->create(sub { $commands{lc($parv[0])}{code}->($target->[0], $nick, $args) if $args; $commands{lc($parv[0])}{code}->($target->[0], $nick) if !$args; }); my @void = $thread->join(); $thread->kill('SIGUSR1'); threads->exit; # snip Yes, threads are installed. Any idea why this fails? It gives me a completely obscure error that really has nothing to do with the threads at all, but the code is functional unthreaded. Error: (in cleanup) Where's _elem?!!? at /usr/local/lib/perl5/site_perl/5.12.2/LWP/UserAgent/Determined.pm line 9 during global destruction. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.12.2/WWW/CPAN.pm line 19 during global destruction. If you're interested, https://github.com/miniCruzer/Aspire/blob/poe/bin/aspire is the file being edited, down at lines 184 and 185. Code with threads have not been pushed.
|