summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhypnotoad <yoda@etoyoc.com>2014-09-02 22:06:21 (GMT)
committerhypnotoad <yoda@etoyoc.com>2014-09-02 22:06:21 (GMT)
commita0116826f3c821cd26c8719e12118ef613339dec (patch)
tree1e53651d48e6dda72c608044f4b50c918bdd90d6
parent4728be7edc60cc8713bb9c9b153722afc93f1e67 (diff)
parenta4a3d764f5bc4047858e2a14a54d26c55b1cf0c0 (diff)
downloadtcl-a0116826f3c821cd26c8719e12118ef613339dec.zip
tcl-a0116826f3c821cd26c8719e12118ef613339dec.tar.gz
tcl-a0116826f3c821cd26c8719e12118ef613339dec.tar.bz2
Merging in the "official" windows hang patch
-rw-r--r--doc/tclsh.19
-rw-r--r--doc/zvfs.n39
-rw-r--r--generic/tclEvent.c3
-rw-r--r--tests/aaa_exit.test41
4 files changed, 91 insertions, 1 deletions
diff --git a/doc/tclsh.1 b/doc/tclsh.1
index 6ed5eb6..25d97c5 100644
--- a/doc/tclsh.1
+++ b/doc/tclsh.1
@@ -143,6 +143,15 @@ incomplete commands.
.SH "STANDARD CHANNELS"
.PP
See \fBTcl_StandardChannels\fR for more explanations.
+.SH ZIPVFS
+.PP
+When a zipfile is concatenated to the end of a \fBtclsh\fR, on
+startup the contents of the zip archive will be mounted as the
+virtual file system /zvfs. If a top level directory tcl8.6 is
+present in the zip archive, it will become the directory loaded
+as env(TCL_LIBRARY). If a file named \fBmain.tcl\fR is present
+in the top level directory of the zip archive, it will be sourced
+instead of the shell's normal command line handing.
.SH "SEE ALSO"
auto_path(n), encoding(n), env(n), fconfigure(n)
.SH KEYWORDS
diff --git a/doc/zvfs.n b/doc/zvfs.n
new file mode 100644
index 0000000..ba33fb6
--- /dev/null
+++ b/doc/zvfs.n
@@ -0,0 +1,39 @@
+'\"
+'\" Copyright (c) 2014 Sean Woods
+'\"
+'\" See the file "license.terms" for information on usage and redistribution
+'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+'\"
+.TH zvfs n 0.1 Zvfs "Zvfs Commands"
+.so man.macros
+.BS
+'\" Note: do not modify the .SH NAME line immediately below!
+.SH NAME
+http \- Client-side implementation of the HTTP/1.1 protocol
+.SH SYNOPSIS
+\fBpackage require zvfs ?0.1?\fR
+.sp
+\fB::zvfs::mount \fIZIPFILE \fIMOUNTPOINT\fR ...?
+.sp
+\fB::zvfs::unmount \fIZIPFILE\fR ...?
+.sp
+\fB::zvfs::append ?\fI\-option value\fR ...?
+.sp
+\fB::zvfs::add ?\fI\-option value\fR ...?
+.sp
+\fB::zvfs::exists ?\fI\-option value\fR ...?
+.sp
+\fB::zvfs::info ?\fI\-option value\fR ...?
+.sp
+\fB::zvfs::list ?\fI\-option value\fR ...?
+.sp
+\fB::zvfs::dump ?\fI\-option value\fR ...?
+.sp
+\fB::zvfs::start ?\fI\-option value\fR ...?
+.BE
+.SH DESCRIPTION
+.PP
+The \fBzvfs\fR package provides tcl with the ability to manipulate
+the contents of a zip file archive as a virtual file system.
+.PP
+The \fB::zvfs::mount\fR procedure mounts a zipfile as a VFS. \ No newline at end of file
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index a7cd467..ab219a6 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -1299,7 +1299,8 @@ Tcl_FinalizeThread(void)
TclFinalizeAsync();
TclFinalizeThreadObjects();
}
- if (TclFullFinalizationRequested()) {
+ if (TclFullFinalizationRequested()) { /* useless if we are facing a quick-exit */
+
/*
* Blow away all thread local storage blocks.
*
diff --git a/tests/aaa_exit.test b/tests/aaa_exit.test
new file mode 100644
index 0000000..51a94d7
--- /dev/null
+++ b/tests/aaa_exit.test
@@ -0,0 +1,41 @@
+# Commands covered: exit, emphasis on finalization hangs
+#
+# This file contains a collection of tests for one or more of the Tcl
+# built-in commands. Sourcing this file into Tcl runs the tests and
+# generates output for errors. No output means no errors were found.
+#
+# Copyright (c) 1991-1993 The Regents of the University of California.
+# Copyright (c) 1994-1997 Sun Microsystems, Inc.
+# Copyright (c) 1998-1999 by Scriptics Corporation.
+#
+# See the file "license.terms" for information on usage and redistribution
+# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+
+if {[lsearch [namespace children] ::tcltest] == -1} {
+ package require tcltest 2
+ namespace import -force ::tcltest::*
+}
+
+
+test exit-1.1 {normal, quick exit} {
+ set f [open "|[interpreter] << \"exec [interpreter] << {set ::env(TCL_FINALIZE_ON_EXIT) 0;exit}\" 2>@ stderr" r]
+ set aft [after 5000 {set done "Quick exit hangs !!!"}]
+ fileevent $f readable {after cancel $aft;set done OK}
+ vwait done
+ catch {fconfigure $f -blocking 0;close $f}
+ set done
+} OK
+
+test exit-1.2 {full-finalized exit} {
+ set f [open "|[interpreter] << \"exec [interpreter] << {set ::env(TCL_FINALIZE_ON_EXIT) 1;exit}\" 2>@ stderr" r]
+ set aft [after 5000 {set done "Full-finalized exit hangs !!!"}]
+ fileevent $f readable {after cancel $aft;set done OK}
+ vwait done
+ catch {fconfigure $f -blocking 0;close $f}
+ set done
+} OK
+
+
+# cleanup
+::tcltest::cleanupTests
+return