retry [PATCH] 5.004_59: the perlhist.pod etc
[p5sagit/p5-mst-13.2.git] / ext / Thread / Thread.pm
1 package Thread;
2 require Exporter;
3 require DynaLoader;
4 use vars qw($VERSION @ISA @EXPORT);
5
6 $VERSION = "1.0";
7
8 @ISA = qw(Exporter DynaLoader);
9 @EXPORT_OK = qw(yield cond_signal cond_broadcast cond_wait async);
10
11 =head1 NAME
12
13 Thread - multithreading
14
15 =head1 SYNOPSIS
16
17     use Thread;
18
19     my $t = new Thread \&start_sub, @start_args;
20
21     $t->join;
22
23     my $tid = Thread->self->tid; 
24
25     my $tlist = Thread->list;
26
27     lock($scalar);
28
29     use Thread 'async';
30
31     use Thread 'eval';
32
33 =head1 DESCRIPTION
34
35 The C<Threads> module provides multithreading.
36
37 =head1 SEE ALSO
38
39 L<attrs>, L<Thread::Queue>, L<Thread::Semaphore>, L<Thread::Specific>.
40
41 =cut
42
43 #
44 # Methods
45 #
46
47 #
48 # Exported functions
49 #
50 sub async (&) {
51     return new Thread $_[0];
52 }
53
54 sub eval {
55     return eval { shift->join; };
56 }
57
58 bootstrap Thread;
59
60 1;