This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
allow use threads qw(yield)
authorDave Mitchell <davem@fdisolutions.com>
Tue, 14 May 2002 22:49:47 +0000 (23:49 +0100)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 14 May 2002 22:15:41 +0000 (22:15 +0000)
Message-ID: <20020514224947.F25049@fdgroup.com>

p4raw-id: //depot/perl@16599

ext/threads/threads.pm
ext/threads/threads.xs

index 2851343..d74e85f 100755 (executable)
@@ -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<use threads qw(yield)> then use just a bare C<yield> in your
+code.
+
 =item threads->list();
 
 This will return a list of all non joined, non detached threads.
index 271aa4a..f957a4a 100755 (executable)
@@ -601,7 +601,12 @@ PPCODE:
 }
 
 void
-ithread_yield(ithread *thread)
+yield(thread = 'threads')
+CODE:
+{
+    YIELD;
+}
+       
 
 void
 ithread_detach(ithread *thread)