From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21132 invoked by alias); 23 Jul 2002 04:19:37 -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 21124 invoked from network); 23 Jul 2002 04:19:33 -0000 Received: from unknown (HELO mail01c.rapidsite.net) (207.158.192.68) by sources.redhat.com with SMTP; 23 Jul 2002 04:19:33 -0000 Received: from www.nt.bluesoft-inc.com (128.242.40.105) by mail01c.rapidsite.net (RS ver 1.0.63s) with SMTP id 060188 for ; Tue, 23 Jul 2002 00:19:19 -0400 (EDT) From: "Nir Nizry" To: Subject: Problem with pthread_cond_timedwait(). Date: Mon, 22 Jul 2002 21:19:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Loop-Detect: 1 X-SW-Source: 2002/txt/msg00084.txt.bz2 Hello All, I have a problem with pthread_cond_timedwait(). I have a system with 5 threads that in their main loop wait with a timeout (timedwait) on a condition variable to be set. what I get is, that sometimes a thread enters the pthread_cond_timedwait() function, and doesn't come out, even if the timeout time arrives. after this happens, the other threads get stuck in the mutex lock before entering the pthread_cond_timedwait() as if the mutex is already locked. I suspect that somehow either the pthread_cond_timedwait() function does not release the mutex or does not return when the timeout occurs. does someone have an idea' or know of such an incident (or maybe a bug in pthread)?? Thanks. Nir. I added the code fraction where it get stucked (this is the ONLY place in the code where the messageMutex is locked): pthread_mutex_lock(messageMutex); waitResult = 0; while( m_theGeneralQueue->isEmpty() && !shouldStopThreadGlobalLoop && (waitResult != ETIMEDOUT)) waitResult = pthread_cond_timedwait(newMessageEvent, messageMutex, &timeout); pthread_mutex_unlock(messageMutex); ----------------------------------------- mailto:nir.nizry@bluesoft-inc.com -----------------------------------------