From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16570 invoked by alias); 4 Mar 2005 15:53:15 -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 16234 invoked from network); 4 Mar 2005 15:53:00 -0000 Received: from unknown (HELO rproxy.gmail.com) (64.233.170.205) by sourceware.org with SMTP; 4 Mar 2005 15:53:00 -0000 Received: by rproxy.gmail.com with SMTP id c51so590904rne for ; Fri, 04 Mar 2005 07:52:59 -0800 (PST) Received: by 10.38.78.56 with SMTP id a56mr77527rnb; Fri, 04 Mar 2005 07:52:58 -0800 (PST) Received: by 10.38.75.68 with HTTP; Fri, 4 Mar 2005 07:52:58 -0800 (PST) Message-ID: Date: Fri, 04 Mar 2005 15:53:00 -0000 From: Dmitry Sernii Reply-To: Dmitry Sernii To: pthreads-win32@sources.redhat.com Subject: Handle leak when using pthread mutex with win32 api threads Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005/txt/msg00018.txt.bz2 Hello All! I have handle leak, when using win32 api threads with pthread mutexes. I'm using pthread-win32 2005-01-03 pthread snapshot. Here is the sample application which reproduce the problem: #include #include #include const int max_threads = 500; DWORD WINAPI threadProc(void* param) { static pthread_mutex_t mutex(PTHREAD_RECURSIVE_MUTEX_INITIALIZER); pthread_mutex_lock(&mutex); pthread_mutex_unlock(&mutex); return 0; } void main() { DWORD id; HANDLE th[max_threads]; int i; for (i=0;i