Re: thred's pids

[email protected] (Mihai Vlad)
Newsgroups perl.ithreads
Message-ID <[email protected]>
At this script i get this response:

Scalars leaked: 1
USR1 ALRM
2
2
thread failed to start: Usage: Thread::Signal::_threadpid() at ./test 
line 13.
test.pl (text/plain, 437 B)
#!/usr/bin/perl


use threads;
use Thread::Signal;
use threads::shared;



sub bubu	{	
		@tid = Thread::Signal->tids( 'ALRM' );
		print "@tid\n";
		$x   = Thread::Signal->_threadpid($tid[0]);
		print "$x\n";
		}


Thread::Signal->register;
Thread::Signal->automatic(qw(ALRM USR1));
@automatic = Thread::Signal->automatic;

print "@automatic\n";
$thr	=	threads->new(\&bubu);
$threadtid	=	$thr->tid();
print "$threadtid\n";

$thr->join();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.