summaryrefslogtreecommitdiff
path: root/ext/Thread
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-18 16:51:04 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-18 16:51:04 +0000
commit3487771ddbb6a6913db5c4e74398b9812ab6476b (patch)
tree85b64c0c2b51bf762d04481a974ccb8c4b8cdb38 /ext/Thread
parenta0231f0e83307f241a212cdcb7ecea46e3dbf08c (diff)
downloadperl-3487771ddbb6a6913db5c4e74398b9812ab6476b.tar.gz
Bring MANIFEST up to date. Add new thread tests.
p4raw-id: //depot/perl@265
Diffstat (limited to 'ext/Thread')
-rw-r--r--ext/Thread/die.t16
-rw-r--r--ext/Thread/die2.t16
2 files changed, 32 insertions, 0 deletions
diff --git a/ext/Thread/die.t b/ext/Thread/die.t
new file mode 100644
index 0000000000..623940579f
--- /dev/null
+++ b/ext/Thread/die.t
@@ -0,0 +1,16 @@
+use Thread 'async';
+
+$t = async {
+ print "here\n";
+ die "success";
+ print "shouldn't get here\n";
+};
+
+sleep 1;
+print "joining...\n";
+eval { @r = $t->join; };
+if ($@) {
+ print "thread died with message: $@";
+} else {
+ print "thread failed to die successfully\n";
+}
diff --git a/ext/Thread/die2.t b/ext/Thread/die2.t
new file mode 100644
index 0000000000..f6b695520f
--- /dev/null
+++ b/ext/Thread/die2.t
@@ -0,0 +1,16 @@
+use Thread 'async';
+
+$t = async {
+ sleep 1;
+ print "here\n";
+ die "success if preceded by 'thread died...'";
+ print "shouldn't get here\n";
+};
+
+print "joining...\n";
+@r = eval { $t->join; };
+if ($@) {
+ print "thread died with message: $@";
+} else {
+ print "thread failed to die successfully\n";
+}