Leser: 1
6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl
use threads;
sub thr_func
{
# Thread 'cancellation' signal handler
$SIG{'KILL'} = sub { threads->exit(); };
}
# Create a thread
my $thr = threads->create('thr_func');
# Signal the thread to terminate, and then detach
# it so that it will get cleaned up automatically
$thr->kill('KILL')->detach();
QuoteFehler: Can't locate object method "kill" via package "threads" at... usw.
1
2
my $old_size = threads->set_stack_size(16*8096);
print "stack size for thrctrl: ".$thrctrl->get_stack_size()."\n";
QuoteErgebnis: stacksize für 129536 (stimmt!)
$SIG{'KILL'} = sub { threads->exit(); };
QuoteThread 1 terminated abnormally: Can't locate object method "exit" via package "threads" at...
Quote1.33 Mon Jul 3 10:11:20 EDT 2006
- 'exit' inside a thread silently terminates thread only
- Added 'threads->exit()' (just calls CORE::exit(0))
6 Einträge, 1 Seite |