From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18718 invoked by alias); 27 Sep 2005 15:49:03 -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 18629 invoked by uid 22791); 27 Sep 2005 15:48:49 -0000 Received: from xproxy.gmail.com (HELO xproxy.gmail.com) (66.249.82.197) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 27 Sep 2005 15:48:49 +0000 Received: by xproxy.gmail.com with SMTP id r21so1533650wxc for ; Tue, 27 Sep 2005 08:48:47 -0700 (PDT) Received: by 10.70.112.2 with SMTP id k2mr2982043wxc; Tue, 27 Sep 2005 08:48:47 -0700 (PDT) Received: from BOGGIEMOTH ( [217.26.152.52]) by mx.gmail.com with ESMTP id i37sm433720wxd.2005.09.27.08.48.45; Tue, 27 Sep 2005 08:48:47 -0700 (PDT) Date: Tue, 27 Sep 2005 15:49:00 -0000 From: Dmitrii Sernii Reply-To: Dmitrii Sernii Message-ID: <277109545.20050927184845@gmail.com> To: pthreads-win32@sources.redhat.com Subject: Re: Problem with pthread_cond_timedwait() In-Reply-To: <1130.130.192.136.198.1127830895.squirrel@130.192.136.198> References: <1402.130.192.136.198.1127819578.squirrel@130.192.136.198> <731315850.20050927161549@gmail.com> <1130.130.192.136.198.1127830895.squirrel@130.192.136.198> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2005/txt/msg00120.txt.bz2 Hello, for me this timeout makes cond_timedwait wait for 10 seconds: timespec timeout; timeout.tv_sec = time(0)+10; timeout.tv_nsec = 0; Try to check return code of the pthread_cond_timedwait. Probably you forgot to initialize mutex, or lock it before calling this function. FL> SYSTEMTIME now; FL> GetLocalTime( &now ); FL> timeout.tv_sec = now.wSecond + sec; FL> timeout.tv_nsec = now.wMilliseconds*1E6 + nsec; this code will not work, because wSeconds - maximum value is 59. To use GetLocalTime you'll need to use all values starting from wYear.. multiply them on number of seconds they have and add to each other. -- Best regards, Dmitrii Sernii