return threads->new($cref,@_);
}
+sub object {
+ return undef unless @_ > 1;
+ foreach (threads->list) {
+ return $_ if $_->tid == $_[1];
+ }
+ return undef;
+}
+
$threads::threads = 1;
bootstrap threads $VERSION;
$thread->detach();
$thread = threads->self();
+ $thread = threads->object( $tid );
$thread->tid();
threads->tid();
NB the class method C<< threads->tid() >> is a quick way to get the
current thread id if you don't have your thread object handy.
+=item threads->object( tid )
+
+This will return the thread object for the thread associated with the
+specified tid. Returns undef if there is no thread associated with the tid
+or no tid is specified or the specified tid is undef.
+
=item threads->yield();
This is a suggestion to the OS to let this thread yield CPU time to other