This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rewrote programmer-level condition variables from scratch. Added
[perl5.git] / Thread.pm
index 9ea8cd8..d2f2d8b 100644 (file)
--- a/Thread.pm
+++ b/Thread.pm
@@ -2,19 +2,28 @@ package Thread;
 require Exporter;
 require DynaLoader;
 @ISA = qw(Exporter DynaLoader);
-@EXPORT_OK = qw(sync fast yield);
+@EXPORT_OK = qw(sync fast yield cond_signal cond_broadcast cond_wait
+              async);
+
+#
+# Methods
+#
+
+#
+# Exported functions
+#
+sub async (&) {
+    return new Thread $_[0];
+}
 
-warn "about to bootstrap Thread\n";
 bootstrap Thread;
 
 my $cv;
-foreach $cv (\&yield, \&sync, \&join, \&fast,
-           \&waituntil, \&signal, \&broadcast) {
-    warn "Thread.pm: calling fast($cv)\n";
+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
-sync(\&Thread::Cond::new);     # this needs syncing because of condpair_table
 
 1;