diff options
author | Christopher Faylor <me@cgf.cx> | 2003-06-02 21:22:02 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-06-02 21:22:02 +0000 |
commit | 3786526ea849a4b7daba6ca5609bf8c4445c894e (patch) | |
tree | c5e90fd103be2fe5bc034a4ec85a86bb5eaec389 /winsup/cygwin/cygthread.cc | |
parent | cbdc3d178024f9637bdfc3af410572274f6dd91b (diff) | |
download | cygnal-3786526ea849a4b7daba6ca5609bf8c4445c894e.tar.gz cygnal-3786526ea849a4b7daba6ca5609bf8c4445c894e.tar.bz2 cygnal-3786526ea849a4b7daba6ca5609bf8c4445c894e.zip |
* cygthread.h (cygthread::terminate_thread): Mark private.
* cygthread.cc (cygthread::terminate_thread): Deallocate free_range thread
stuff.
Diffstat (limited to 'winsup/cygwin/cygthread.cc')
-rw-r--r-- | winsup/cygwin/cygthread.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc index e3c177e6b..4945c5bb5 100644 --- a/winsup/cygwin/cygthread.cc +++ b/winsup/cygwin/cygthread.cc @@ -258,10 +258,15 @@ cygthread::terminate_thread () system_printf ("VirtualFree of allocation base %p<%p> failed, %E", stack_ptr, m.AllocationBase); - h = NULL; - __name = NULL; - stack_ptr = NULL; - (void) InterlockedExchange (&inuse, 0); /* No longer in use */ + if (is_freerange) + free (this); + else + { + h = NULL; + __name = NULL; + stack_ptr = NULL; + (void) InterlockedExchange (&inuse, 0); /* No longer in use */ + } } /* Detach the cygthread from the current thread. Note that the |