From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23469 invoked by alias); 14 May 2003 07:53:42 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 23429 invoked from network); 14 May 2003 07:53:42 -0000 Received: from unknown (HELO ausyms50.ca.com) (155.35.248.106) by sources.redhat.com with SMTP; 14 May 2003 07:53:42 -0000 Received: from ausyms21.ca.com ([155.35.201.5]) by ausyms50.ca.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 14 May 2003 17:53:40 +1000 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: tsd cleanup problem when used with native threads Date: Wed, 14 May 2003 07:53:00 -0000 Message-ID: <1395B4B334FCC143B36AF788E68B6381121F6E@ausyms21.ca.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Reddie, Steven" To: X-OriginalArrivalTime: 14 May 2003 07:53:40.0565 (UTC) FILETIME=[EF161050:01C319ED] X-SW-Source: 2003/txt/msg00050.txt.bz2 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 Development Leader - eTrust ETPKI Computer Associates Pty Ltd (Australia)