This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

tsd cleanup problem when used with native threads


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
leaked.

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?

Regards,
Steven
--
Steven Reddie <Steven.Reddie@ca.com>
Development Leader - eTrust ETPKI
Computer Associates Pty Ltd (Australia)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]