public inbox for
 help / color / mirror / Atom feed
* tsd cleanup problem when used with native threads
@ 2003-05-14  7:53 Reddie, Steven
  0 siblings, 0 replies; only message in thread
From: Reddie, Steven @ 2003-05-14  7:53 UTC (permalink / raw)
  To: pthreads-win32

I'm getting a leaked thread handle and small memory leak when using tsd
from a non-threads-created-thread.  The reason for this is that our tsd
cleanup callback calls pthread_self which results in the
ptw32_selfThreadKey slot being initialized again, and this is then

I can fix the problem by rearranging the two lines at
pthread_win32_attach_detach_np.c:162-163 so that the cleanup is done
before ptw32_selfThreadKey is set to NULL.  This way, when pthread_self
is called during tsd cleanup self will not be recreated.

Does this sound like a reasonable change, and if so is it possible to
have it done in cvs?

Steven Reddie <>
Development Leader - eTrust ETPKI
Computer Associates Pty Ltd (Australia)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-14  7:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14  7:53 tsd cleanup problem when used with native threads Reddie, Steven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).