From: Dave Mitchell Date: Tue, 14 May 2002 22:49:47 +0000 (+0100) Subject: allow use threads qw(yield) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=70f2e746b964cdea678c9678d962177f1ba4632d;p=p5sagit%2Fp5-mst-13.2.git allow use threads qw(yield) Message-ID: <20020514224947.F25049@fdgroup.com> p4raw-id: //depot/perl@16599 --- diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm index 2851343..d74e85f 100755 --- a/ext/threads/threads.pm +++ b/ext/threads/threads.pm @@ -45,7 +45,7 @@ require DynaLoader; our @ISA = qw(Exporter DynaLoader); -our %EXPORT_TAGS = ( all => [qw()]); +our %EXPORT_TAGS = ( all => [qw(yield)]); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); @@ -163,6 +163,9 @@ to get current thread id if you don't have your thread handy. This will tell the OS to let this thread yield CPU time to other threads. However this is highly depending on the underlying thread implementation. +You may do C then use just a bare C in your +code. + =item threads->list(); This will return a list of all non joined, non detached threads. diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 271aa4a..f957a4a 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -601,7 +601,12 @@ PPCODE: } void -ithread_yield(ithread *thread) +yield(thread = 'threads') +CODE: +{ + YIELD; +} + void ithread_detach(ithread *thread)