2001-05-27  David Gravereaux <davygrvy@pobox.com>

	* tests/thread.test: fixed small typo in comments.

2001-08-03  Jeff Hobbs  <jeffh@ActiveState.com>

	* Makefile.in: corrected handling of VERSION

	* generic/threadCmd.c:
	* generic/thread.h: added Thread_SafeInit

	* win/vc/makefile.vc: added -DBUILD_thread to cflags.

2001-05-27  David Gravereaux <davygrvy@pobox.com>

	* configure:
	* configure.in:
	* Makefile.in:
		Added package versions to the compile flags. [bug #421246]

2001-04-28  David Gravereaux <davygrvy@pobox.com>

	* generic/threadCmd.c (NewThread): removed the previous addition of
	Tcl_FinalizeThread.  Tcl_ExitThread calls it anyways (my mistake).
	The resource leak was in the core.  See ->
	http://sourceforge.net/tracker/?func=detail&atid=110894&aid=419683&group_id=10894
	for the fix.  That patch is pending approval.

	To acheive the same behavior of emptying the event loop the way
	thread::wait used to work, use the following:
		set T [thread::create {thread::wait; update}]
		thread::send -async $T thread::unwind

	* generic/thread.h:
	* win/vc/makefile.vc:
	* win/vc/thread.rc:
	* win/vc/pkg.vc (new): Moved version numbers from the header file.  It isn't
	an export API or anything.  Moved version numbers to the build files.  I'll
	modify configure.in and makefile.in a little later.

2001-04-26  David Gravereaux <davygrvy@pobox.com>

	* config/* (new): old site-wide config directory re-added.

	* generic/threadCmd.c (ThreadEventProc): ThreadErrorProc now
	supported in asyncronous sends when Tcl_Eval returns other than
	TCL_OK.  Errors were silently ignored prior to this. Bug #219324

	==== INTERFACE CHANGE ====
	* generic/threadCmd.c:
	* generic/thread.h: thread::exit renamed to thread::unwind. The
	name of 'exit' is misleading.  An exit implies an unconditional
	return.  But there are conditions.  'unwind' describes with more
	clarity what's happening to the prior thread::wait.  For example:

	  # parent thread
	  set T [thread::create {source worker.tcl}]
	  ....
	  thread::send -async $T doStuff
	  ....
	  thread::send -async $T doStuff
	  ....
	  thread::send -async $T thread::unwind

	  # worker.tcl
	  proc init    {} {#do initialization}
	  proc cleanup {} {#do cleanup}
	  proc doStuff {} {#the work}
	  init
	  thread::wait
	  cleanup

	When worker.tcl is sourced, the execution stops at thread::wait and
	the event loop is entered.  When thread::unwind is sent to the worker,
	thread::wait falls-out and cleanup is called.  The condition for
	thread::unwind to cause an exit is determined by the script.  If
	thread::wait was the last Tcl command in the script, yes the thread
	will exit.  But if thread::wait is not the last, the execution of the
	script is just continued.  Hence, the name change to clarify this fact.

	Package version has not been changed.  There hasn't been an official
	release of 2.2, so it stays.

	* doc/thread.n:
	* tests/thread.test: Replaced thread::exit with thread::unwind and
	documented the change and clarified the subtleties.

	* win/vc/makefile.vc:
	* win/vc/thread.dsp: Changed NODEBUG macro to be DEBUG instead.
	Double negatives give me a headache.  DEBUG=1 makes more sense
	to me than NODEBUG=0.  Not that I didn't think you wouldn't have
	disagreed it was confusing, no?

	* win/vc/config.vc: Added a reminder to edit before using.
	* win/vc/thread.rc: Added authors and removed the Ajuba branding.

2001-04-25  David Gravereaux <davygrvy@pobox.com>

	* generic/threadCmd.c (ThreadWait)(NewThread): Removed the event
	loop sinking which was probably done because Tcl_FinalizeThread
	was missing from NewThread().  Now the event loop is cleaned
	by Tcl_FinalizeThread and ThreadWait doesn't manipulate events
	that don't belong to it.  Bug #418689 and #418693

	* generic/threadCmd.c (Thread_Init): logic fix in a version check
	for determining the 8.3 package subset.

2000-11-02  David Gravereaux <davygrvy@ajubasolutions.com>

	* generic/threadCmd.c (NewThread): Added logic to test for a
	working Tcl_Init() based on the core version at runtime and ignore
	its failure in versions 8.3.[1,2] and 8.4a1.  [BUG: 5301]

2000-10-26  David Gravereaux <davygrvy@ajubasolutions.com>

	* generic/thread.h:
	* win/vc/config.vc:
	* win/vc/makefile.vc:
	* win/vc/thread.dsp: upped version numbers to 2.2 along with adding
	a new macro (THREAD_VERSION_SUBSET83) defining the version when
	loaded into an 8.3 core.  Which happens to be "2.1.1" at this time.

	* generic/threadCmd.c (Thread_Init): Added logic to allow setting
	the package version at runtime to "2.2" when compiled against 8.4
	and loaded into 8.4.  When compiled against 8.4, yet loaded into
	8.3, thread::join and thread::transfer are not added to the interp
	and the package version is set to "2.1.1" instead from the single
	binary.  [ie. multiple interfaces in one binary]  When compiled
	against 8.3, thread::join and thread::transfer are non-existant and
	the package version is always "2.1.1" to maintain a consistent
	interface in all combinations (as per discussions with Don Porter).

2000-10-16  Zoran Vasiljevic <zoran@munich.com>

	* generic/threadSvCmd.c ThreadSvUnsetObjCmd(): deadlocked.
        Forgot to release shared-array lock which resulted in
        deadlock after first successful unset of the variable.

2000-08-29  David Gravereaux <davygrvy@ajubasolutions.com>

	* generic/threadCmd.c (NewThread): Tcl_Init return value wasn't
	being verified.  Added a check and failure logic to fall-out.
	[Bug: 5301]

2000-08-28  David Gravereaux <davygrvy@ajubasolutions.com>

	* generic/threadCmds.c (Thread_Init): Added logic to enable
	thread::join and thread::transfer when loaded into an 8.4+ core.
	We don't want a seg fault when the Stubs tables don't match for
	the functions that don't exist in an 8.3 core.

2000-08-23  Brent Welch <welch@ajubasolutions.com>

	* configure.in:
	* win/vc/makefile.vc: Changed to version 2.1
	* generic/threadCmds.c: Made the code that uses new Tcl 8.4 APIs
	conditional using #ifdef.  Tested with 8.3.2
	* Applied thread-2-1 tag for use with tclhttpd bundled release.

2000-08-21  David Gravereaux <davygrvy@ajubasolutions.com>

	* win/vc/makefile.vc:
	* win/vc/thread.rc: added version numbers to filename to follow
	Tcl standards.

	* doc/thread.tmml(new): Initial TMML document.

2000-08-20  David Gravereaux <davygrvy@ajubasolutions.com>

	* win/vc/config.vc:
	* win/vc/makefile.vc:
	* win/vc/README.txt:
	* win/vc/thread.dsp:  A near top down rewrite that adds
	four more build configurations.  See README.TXT for the
	details.

	* win/vc/.cvsignore:  A few more glob patterns added to match
	the new build directories.

2000-08-09  David Gravereaux <davygrvy@ajubasolutions.com>

	* win/vc/thread.rc: swapped "Scriptics Corp" for "Ajuba
	Solutions"

	* win/vc/config.vc:
	* win/vc/makefile.vc: cleaned-up old cruft.  Added new files
	from Zoran's patches.  made swapping to MSDev 6.0 easier.
	Removed the '!if $(_NMAKE_VER) > 162' test for 2 reasons.

	1) batchmode inference rules are valid since MSDev 5.0 and
	the core can't be built with less.  So don't bother testing.

	2) nmake.exe that comes with MSDev 6.0 has a bug with the
	meaning of that macro and MS decided to use a string instead
	breaking the integer comparison test.

	Also added vcvars32.bat to a new setup rule and got config.vc
	much smaller.

	* win/vc/thread.dsp: Added new files from Zoran's patch.

	* win/.cvsignore(deleted):
	* win/vc/.cvsignore(added): moved file to help keep a cleaner
	build environment.

	* generic/threadSvCmd.c: Added some additional casting of
	Tcl_GetHashValue to prevent compiler warnings.

	* generic/threadCmd.c(ThreadWait): Removed the event loop
	sinking after the "while(..) Tcl_DoOneEvent();" because this
	extension is only responsible for it's own events in the event
	loop.  Any other extension that's queueing events must be
	responsible for it's own cleanup and should be aware of when
	the interp (ie. this thread) is going away when we fall-out
	to Tcl_DeleteInterp from the Tcl_Eval in NewThread().  If other
	extensions (like Tk) don't become aware, then they need to add
	a Tcl_CallWhenDeleted handler.

2000-07-14 Zoran Vasiljevic <zoran@munich.com>

	* generic/threadCmd.c: improved thread::exit behaviour
	  now does a better job of draining the event loop before exit.
	  may have some wishes open, though - see ThreadWait().
	
	* generic/threadSpCmd.c, generic/threadSvCmd.c:
	  added some comments in function headers.
	  docs/tests for above still pending.
	
2000-07-03 Zoran Vasiljevic <zoran@munich.com>
	
   	Summary of changes:

	* generic/threadSpCmd.c: new file with implementation of 
	  "thread::mutex" and "thread::cond" commands. Documentation 
	  and tests are still pending.
	
	* generic/threadSvCmd.c: new file with implementation of 
	  "thread::sv_*" family of commands modeled after AOLserver
	  nsv_* ones. Documentation and tests are still pending.

	* Makefile.in: fixed for the two above

	* doc/thread.html 
	* doc/thread.n: added 'thread::exists' docs

	* generic/thread.h added declarations for new commands (above)
	
	* generic/threadCmd.c:
	
	  Added "thread::exists" command.

	  Moved most of internal functions in threadCmd.c to statics,
          except the Thread*ObjCmd(). 

	  Changed behaviour of "thread::exit". It now simply flips the
          bit to signal thread stuck in thread::wait to gracefuly exit.
          Consequence: command now does not trigger error on thread exit.
          Also, thread event queue is now properly cleared.
          ThreadWait() and ThreadStop() are newly added to support this.
          Also the ThreadSpecificData has one more integer: "stopped"

	  Replaced ref's to obsolete Tcl_GlobalEval() with Tcl_EvalEx().

	  Fixed broken 'thread::create -joinable script';
          was missing initialization of script variable

	  Added calls to initialize new commands in threadSpCmd.c
	  and threadSvCmd.c files.

2000-05-18 Brent Welch <welch@scriptics.com>

	* Restored Andreas' changes for transferring sockets.

2000-05-16 Brent Welch <welch@scriptics.com>

	* Temprarily rolled back Andreas' changes so I can fix up
	the 2.0 release (configure and Make).  Also need to apply
	a 2.0 tag.

2000-05-09 Andreas Kupries  <a.kupries@westend.com>

	* tests/thread.test: Removed dependency on aclocals.m4. Using a
	  real temporary file now, as created by a call to
	  tcltest::makeFile. Updated test 6.3 to use the correct length
	  information.

2000-05-04  Andreas Kupries <a.kupries@westend.com>

	* Overall changes:
	  (1) Added joinable threads.
	  (2) Added transfer of channels between threads.

	* generic/threadCmd.c: Added functions Thread_Join and
	  ThreadJoinObjCmd.

	  Extended function ThreadCreateObjCmd to handle a
	  -joinable flag.

	  Fixed bug in Thread_Create, the argument 'stacksize' was not
	  used.

	  Removed declaration of ThreadObjCmd, which was not used anywhere
	  else in the code.

	  Added functions Thread_Transfer, ThreadTransferEventProc and
	  ThreadTransferObjCmd. Extended behaviour of ThreadDeleteEvent
	  and ThreadExitProc to deal with the new class of events.

	  Changed usage of ckfree to the more canonical Tcl_Free. Same for
	  ckalloc and Tcl_Alloc.

	* Makefile.in: Fixed bug with regard to the installation of
	  documentation.

	* doc/thread.*: Added documentation of create -joinable,
	  thread::join and thread::transfer.

	* tests/thread.test: Added tests for joining of threads and moving
	  channels between threads.

2000-04-19  Brent Welch <welch@scriptics.com>

	* win/vc/config.rc, Makefile.vc: Fixes from David Gravereaux

2000-04-18  Brent Welch <welch@scriptics.com>

	* Makefile.in: Fixes for make install

2000-04-17  Brent Welch <welch@scriptics.com>

	* generic/threadCmd.c
	Added Tcl_CreateThreadType and TCL_RETURN_THREAD_TYPE
	macros for declaring the NewThread callback proc.

2000-04-11  Brent Welch <welch@scriptics.com>

	* Picked up minor changes from David Gravereaux <davygrvy@bigfoot.com>
	* for compilation on windows with his alternate project files.

2000-04-10  Brent Welch <welch@scriptics.com>

	* Moved all the configure.in, Makefile.in etc. up to the top level out
	* of the unix (and win) subdirectories.  These are now shared.
	* If you are using CVS, you'll want to get the "config" module into
	* this directory, or do the checkout of thread again so the config
	* module is brought in.  You should have a "config" subdirectory of
	* your main thread workspace directory.

2000-04-09  Brent Welch <welch@scriptics.com>

	* Updated to compile against 8.3.1 export thread APIs
	* Added Windows makefiles

2000-03-27  Brent Welch <welch@scriptics.com> (proxy for Andreas Kupries)

	* tests/all.tcl: Added this file
	* tests/thread.test: fixed to use tcltest
	* doc/thread.n: Added this file as clone of thread.html
	# doc/thread.html: fixed typo

