From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13838 invoked by alias); 23 Oct 2012 13:34:30 -0000 Received: (qmail 13771 invoked by uid 22791); 23 Oct 2012 13:34:28 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from exchange.4d.com (HELO exchange.4d.com) (194.177.35.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Oct 2012 13:34:25 +0000 Received: from 4d-xn1-exch.4d.local ([194.177.35.84]) by 4d-xn1-exch ([194.177.35.84]) with mapi; Tue, 23 Oct 2012 15:29:53 +0200 From: Stephane Clairet To: "pthreads-win32@sourceware.org" Date: Tue, 23 Oct 2012 13:34:00 -0000 Subject: pthread_key_delete issue Message-ID: <73C0C0720B9162459C8AF58ED19AD5B65D741FC96F@4d-xn1-exch> x-exclaimer-md-config: 2c2e5a05-a47a-4726-b954-105699434113 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2012/txt/msg00027.txt.bz2 Hi, after migrating from 2.8.0 version to 2.9.1 version, I have an issue with p= thread_key_delete function. Sometimes, the application on which I work freezes after calling pthread_ke= y_delete. In fact, the app is stopped on this line: ptw32_mcs_lock_release (&keyLock)= (line 106 into pthread_key_delete.c file) It seems to be reproduced only when the specific data key concerns several = threads. The explanation is maybe inside the pthread_key_delete implementation: int pthread_key_delete (pthread_key_t key) { ptw32_mcs_lock_acquire (&(key->keyLock), &keyLock); ... while ((assoc =3D (ThreadKeyAssoc *) key->threads) !=3D NULL) { ... ptw32_mcs_lock_release (&keyLock); } } The freeze always occurs when the program try to release the key lock a sec= ond time. I don't know if it's supposed to be supported. Release the key lock outside the while loop seems to fix the issue. Thanks for help. Regards. St=E9phane Stephane Clairet Architecte Logiciel 4D SAS 60, rue d'Alsace 92110 Clichy France Standard : +33 1 40 87 92 00 Email : Stephane.Clairet@4d.com Web : www.4D.com