Re: thred's pids

[email protected] (Elizabeth Mattijsen)
Newsgroups perl.ithreads
Message-ID <f06110416bdb02929c4b8@[192.168.56.3]>
At 4:31 PM +0200 11/4/04, Mihai Vlad wrote:
>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.
>
>
>#!/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]);

_threadpid is an internal subroutine, _not_ a class method.

Try:

    $x   = Thread::Signal::_threadpid($tid[0]);

instead.


>		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();

Liz
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.