* cygtls.cc (cygtls::call2): Move socket cleanup.

(cygtls::remove): Move socket cleanup here.  Don't use _my_tls to reference it.
This commit is contained in:
Christopher Faylor 2005-01-29 03:09:50 +00:00
parent 0eefa5256b
commit 02e221b774
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2005-01-28 Christopher Faylor <cgf@timesys.com>
* cygtls.cc (cygtls::call2): Move socket cleanup.
(cygtls::remove): Move socket cleanup here. Don't use _my_tls to
reference it.
2005-01-26 Christopher Faylor <cgf@timesys.com>
* pinfo.cc (pinfo::init): Avoid a compiler warning.

View File

@ -91,10 +91,6 @@ _cygtls::call2 (DWORD (*func) (void *, void *), void *arg, void *buf)
_my_tls.init_thread (buf, func);
DWORD res = func (arg, buf);
_my_tls.remove (INFINITE);
// FIXME: Need some sort of atthreadexit function to allow things like
// select to control this themselves
if (_my_tls.locals.exitsock != INVALID_SOCKET)
closesocket (_my_tls.locals.exitsock);
ExitThread (res);
}
@ -156,6 +152,10 @@ void
_cygtls::remove (DWORD wait)
{
debug_printf ("wait %p\n", wait);
// FIXME: Need some sort of atthreadexit function to allow things like
// select to control this themselves
if (_my_tls.locals.exitsock != INVALID_SOCKET)
closesocket (locals.exitsock);
do
{
sentry here (wait);