summaryrefslogtreecommitdiff
path: root/Thread.pm
blob: d2f2d8be932a8fe2974f62cf6d4cb5fd7b1f7734 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Thread;
require Exporter;
require DynaLoader;
@ISA = qw(Exporter DynaLoader);
@EXPORT_OK = qw(sync fast yield cond_signal cond_broadcast cond_wait
	       async);

#
# Methods
#

#
# Exported functions
#
sub async (&) {
    return new Thread $_[0];
}

bootstrap Thread;

my $cv;
foreach $cv (\&yield, \&sync, \&join, \&fast, \&DESTROY,
	    \&cond_wait, \&cond_signal, \&cond_broadcast) {
    fast($cv);
}

sync(\&new);	# not sure if this needs to be sync'd

1;