/usr/share/perl5
NameSizeModeActions
App/-0755rm
Archive/-0755rm
Attribute/-0755rm
autodie/-0755rm
B/-0755rm
Carp/-0755rm
CGI/-0755rm
Class/-0755rm
Config/-0755rm
CPAN/-0755rm
CPANPLUS/-0755rm
DBIx/-0755rm
DBM_Filter/-0755rm
Devel/-0755rm
Digest/-0755rm
Encode/-0755rm
encoding/-0755rm
Exporter/-0755rm
ExtUtils/-0755rm
File/-0755rm
Filter/-0755rm
Getopt/-0755rm
HTML/-0755rm
I18N/-0755rm
IO/-0755rm
IPC/-0755rm
JSON/-0755rm
Locale/-0755rm
Log/-0755rm
Math/-0755rm
Memoize/-0755rm
Module/-0755rm
Net/-0755rm
Object/-0755rm
overload/-0755rm
Package/-0755rm
Params/-0755rm
Parse/-0755rm
PerlIO/-0755rm
Pod/-0755rm
pod/-0755rm
Search/-0755rm
TAP/-0755rm
Term/-0755rm
Test/-0755rm
Test2/-0755rm
Text/-0755rm
Thread/-0755rm
Tie/-0755rm
Time/-0755rm
Unicode/-0755rm
unicore/-0755rm
URI/-0755rm
User/-0755rm
vendor_perl/-0755rm
version/-0755rm
warnings/-0755rm
abbrev.pl8380644editdlrm
AnyDBM_File.pm25940644editdlrm
assert.pl12980644editdlrm
attributes.pm148770644editdlrm
autodie.pm117630644editdlrm
AutoLoader.pm149970644editdlrm
AutoSplit.pm196370644editdlrm
autouse.pm42380644editdlrm
base.pm69860644editdlrm
Benchmark.pm285300644editdlrm
bigfloat.pl73680644editdlrm
bigint.pl89590644editdlrm
bigint.pm178520644editdlrm
bignum.pm186730644editdlrm
bigrat.pl44760644editdlrm
bigrat.pm144420644editdlrm
blib.pm21060644editdlrm
bytes.pm23840644editdlrm
bytes_heavy.pl7580644editdlrm
cacheout.pl11220644editdlrm
Carp.pm76110644editdlrm
CGI.pm2614780644editdlrm
charnames.pm156700644editdlrm
complete.pl31910644editdlrm
constant.pm125280644editdlrm
CORE.pod15690644editdlrm
CPAN.pm1309070644editdlrm
CPANPLUS.pm72690644editdlrm
ctime.pl19930644editdlrm
DB.pm192020644editdlrm
DBM_Filter.pm144150644editdlrm
diagnostics.pm173800644editdlrm
Digest.pm104120644editdlrm
DirHandle.pm19370644editdlrm
dotsh.pl21750644editdlrm
Dumpvalue.pm168990644editdlrm
dumpvar.pl152750644editdlrm
English.pm44880644editdlrm
Env.pm51700644editdlrm
exceptions.pl17360644editdlrm
Expect.pm547250644editdlrm
Expect.pod437350644editdlrm
Exporter.pm185950644editdlrm
fastcwd.pl10190644editdlrm
Fatal.pm409660644editdlrm
feature.pm50920644editdlrm
fields.pm95070644editdlrm
FileCache.pm55700644editdlrm
FileHandle.pm67780644editdlrm
filetest.pm40030644editdlrm
find.pl11850644editdlrm
FindBin.pm56580644editdlrm
finddepth.pl11300644editdlrm
flush.pl6420644editdlrm
getcwd.pl14270644editdlrm
getopt.pl13220644editdlrm
getopts.pl14060644editdlrm
hostname.pl7270644editdlrm
if.pm11660644editdlrm
importenv.pl2830644editdlrm
integer.pm32660644editdlrm
less.pm30840644editdlrm
locale.pm8200644editdlrm
look.pl12550644editdlrm
Memoize.pm352950644editdlrm
newgetopt.pl22130644editdlrm
NEXT.pm184810644editdlrm
ok.pm9670444editdlrm
open.pm77400644editdlrm
open2.pl1850644editdlrm
open3.pl1850644editdlrm
overload.pm480500644editdlrm
overloading.pm18010644editdlrm
parent.pm29980644editdlrm
perl5db.pl3176820644editdlrm
PerlIO.pm111220644editdlrm
pwd.pl14780644editdlrm
Safe.pm243260644editdlrm
SelectSaver.pm10760644editdlrm
SelfLoader.pm173410644editdlrm
Shell.pm86850644editdlrm
shellwords.pl2760644editdlrm
sigtrap.pm76110644editdlrm
sort.pm60930644editdlrm
stat.pl5900644editdlrm
strict.pm37160644editdlrm
subs.pm8420644editdlrm
Switch.pm285080644editdlrm
Symbol.pm47940644editdlrm
syslog.pl48060644editdlrm
tainted.pl1640644editdlrm
termcap.pl41140644editdlrm
Test.pm288000644editdlrm
Test2.pm63930444editdlrm
Thread.pm82850644editdlrm
timelocal.pl6900644editdlrm
UNIVERSAL.pm65360644editdlrm
utf8.pm69180644editdlrm
utf8_heavy.pl80010644editdlrm
validate.pl37310644editdlrm
vars.pm23580644editdlrm
version.pm10370644editdlrm
version.pod123150644editdlrm
vmsish.pm43280644editdlrm
warnings.pm161330644editdlrm
Edit: /usr/share/perl5/Thread.pm (8285B)
package Thread; use strict; use warnings; no warnings 'redefine'; our $VERSION = '3.02'; $VERSION = eval $VERSION; BEGIN { use Config; if (! $Config{useithreads}) { die("This Perl not built to support threads\n"); } } use threads 'yield'; use threads::shared; require Exporter; our @ISA = qw(Exporter threads); our @EXPORT = qw(cond_wait cond_broadcast cond_signal); our @EXPORT_OK = qw(async yield); sub async (&;@) { return Thread->new(shift); } sub done { return ! shift->is_running(); } sub eval { die("'eval' not implemented with 'ithreads'\n"); }; sub flags { die("'flags' not implemented with 'ithreads'\n"); }; 1; __END__ =head1 NAME Thread - Manipulate threads in Perl (for old code only) =head1 DEPRECATED The C module served as the frontend to the old-style thread model, called I<5005threads>, that was introduced in release 5.005. That model was deprecated, and has been removed in version 5.10. For old code and interim backwards compatibility, the C module has been reworked to function as a frontend for the new interpreter threads (I) model. However, some previous functionality is not available. Further, the data sharing models between the two thread models are completely different, and anything to do with data sharing has to be thought differently. With I, you must explicitly C variables between the threads. You are strongly encouraged to migrate any existing threaded code to the new model (i.e., use the C and C modules) as soon as possible. =head1 HISTORY In Perl 5.005, the thread model was that all data is implicitly shared, and shared access to data has to be explicitly synchronized. This model is called I<5005threads>. In Perl 5.6, a new model was introduced in which all is was thread local and shared access to data has to be explicitly declared. This model is called I, for "interpreter threads". In Perl 5.6, the I model was not available as a public API; only as an internal API that was available for extension writers, and to implement fork() emulation on Win32 platforms. In Perl 5.8, the I model became available through the C module, and the I<5005threads> model was deprecated. In Perl 5.10, the I<5005threads> model was removed from the Perl interpreter. =head1 SYNOPSIS use Thread qw(:DEFAULT async yield); my $t = Thread->new(\&start_sub, @start_args); $result = $t->join; $t->detach; if ($t->done) { $t->join; } if($t->equal($another_thread)) { # ... } yield(); my $tid = Thread->self->tid; lock($scalar); lock(@array); lock(%hash); my @list = Thread->list; =head1 DESCRIPTION The C module provides multithreading support for Perl. =head1 FUNCTIONS =over 8 =item $thread = Thread->new(\&start_sub) =item $thread = Thread->new(\&start_sub, LIST) C starts a new thread of execution in the referenced subroutine. The optional list is passed as parameters to the subroutine. Execution continues in both the subroutine and the code after the C call. C returns a thread object representing the newly created thread. =item lock VARIABLE C places a lock on a variable until the lock goes out of scope. If the variable is locked by another thread, the C call will block until it's available. C is recursive, so multiple calls to C are safe--the variable will remain locked until the outermost lock on the variable goes out of scope. Locks on variables only affect C calls--they do I affect normal access to a variable. (Locks on subs are different, and covered in a bit.) If you really, I want locks to block access, then go ahead and tie them to something and manage this yourself. This is done on purpose. While managing access to variables is a good thing, Perl doesn't force you out of its living room... If a container object, such as a hash or array, is locked, all the elements of that container are not locked. For example, if a thread does a C, any other thread doing a C won't block. Finally, C will traverse up references exactly I level. C is equivalent to C, while C is not. =item async BLOCK; C creates a thread to execute the block immediately following it. This block is treated as an anonymous sub, and so must have a semi-colon after the closing brace. Like C, C returns a thread object. =item Thread->self The Cself> function returns a thread object that represents the thread making the Cself> call. =item Thread->list Returns a list of all non-joined, non-detached Thread objects. =item cond_wait VARIABLE The C function takes a B variable as a parameter, unlocks the variable, and blocks until another thread does a C or C for that same locked variable. The variable that C blocked on is relocked after the C is satisfied. If there are multiple threads Cing on the same variable, all but one will reblock waiting to reaquire the lock on the variable. (So if you're only using C for synchronization, give up the lock as soon as possible.) =item cond_signal VARIABLE The C function takes a locked variable as a parameter and unblocks one thread that's Cing on that variable. If more than one thread is blocked in a C on that variable, only one (and which one is indeterminate) will be unblocked. If there are no threads blocked in a C on the variable, the signal is discarded. =item cond_broadcast VARIABLE The C function works similarly to C. C, though, will unblock B the threads that are blocked in a C on the locked variable, rather than only one. =item yield The C function allows another thread to take control of the CPU. The exact results are implementation-dependent. =back =head1 METHODS =over 8 =item join C waits for a thread to end and returns any values the thread exited with. C will block until the thread has ended, though it won't block if the thread has already terminated. If the thread being Ced Cd, the error it died with will be returned at this time. If you don't want the thread performing the C to die as well, you should either wrap the C in an C or use the C thread method instead of C. =item detach C tells a thread that it is never going to be joined i.e. that all traces of its existence can be removed once it stops running. Errors in detached threads will not be visible anywhere - if you want to catch them, you should use $SIG{__DIE__} or something like that. =item equal C tests whether two thread objects represent the same thread and returns true if they do. =item tid The C method returns the tid of a thread. The tid is a monotonically increasing integer assigned when a thread is created. The main thread of a program will have a tid of zero, while subsequent threads will have tids assigned starting with one. =item done The C method returns true if the thread you're checking has finished, and false otherwise. =back =head1 DEFUNCT The following were implemented with I<5005threads>, but are no longer available with I. =over 8 =item lock(\&sub) With 5005threads, you could also C a sub such that any calls to that sub from another thread would block until the lock was released. Also, subroutines could be declared with the C<:locked> attribute which would serialize access to the subroutine, but allowed different threads non-simultaneous access. =item eval The C method wrapped an C around a C, and so waited for a thread to exit, passing along any values the thread might have returned and placing any errors into C<$@>. =item flags The C method returned the flags for the thread - an integer value corresponding to the internal flags for the thread. =back =head1 SEE ALSO L, L, L, L =cut