public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: "Reddie, Steven" <Steven.Reddie@ca.com>
To: <pthreads-win32@sources.redhat.com>
Subject: tsd cleanup problem when used with native threads
Date: Wed, 14 May 2003 07:53:00 -0000	[thread overview]
Message-ID: <1395B4B334FCC143B36AF788E68B6381121F6E@ausyms21.ca.com> (raw)

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)

                 reply	other threads:[~2003-05-14  7:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395B4B334FCC143B36AF788E68B6381121F6E@ausyms21.ca.com \
    --to=steven.reddie@ca.com \
    --cc=pthreads-win32@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).