From owner-freebsd-bugs Tue Sep 16 06:30:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA23794 for bugs-outgoing; Tue, 16 Sep 1997 06:30:05 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA23785; Tue, 16 Sep 1997 06:30:01 -0700 (PDT) Resent-Date: Tue, 16 Sep 1997 06:30:01 -0700 (PDT) Resent-Message-Id: <199709161330.GAA23785@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, thz@tuebingen.netsurf.de Received: (from nobody@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA23560; Tue, 16 Sep 1997 06:25:35 -0700 (PDT) Message-Id: <199709161325.GAA23560@hub.freebsd.org> Date: Tue, 16 Sep 1997 06:25:35 -0700 (PDT) From: thz@tuebingen.netsurf.de To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/4554: pthread_cond_wait() doesn't wait for pthread_cond_signal() Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 4554 >Category: bin >Synopsis: pthread_cond_wait() doesn't wait for pthread_cond_signal() >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Sep 16 06:30:00 PDT 1997 >Last-Modified: >Originator: Thomas Zenker >Organization: Lennartz electronic >Release: 2.2.1/2.2.2 >Environment: >Description: pthread_cond_wait returns immediately without waiting for pthread_cond_signal by another thread. the reason is that in pthread_cond_wait the wakeup_time.tv_sec is not explicitely set to "wait forever" (-1). Debugging shows: wakeup_time.tv_sec is allways implicitely set to "wakeup immediately" (0). >How-To-Repeat: Calling pthread_cond_wait() never stops the current thread. >Fix: Set wakeup_time.tv_sec explicitely to wait forever in the function pthread_cond_wait() in file "uthread_cond.c". *** /vol/cdrom/usr/src/lib/libc_r/uthread/uthread_cond.c Fri Sep 20 08:3:50 1996 --- ./uthread_cond.c Tue Sep 16 12:54:56 1997 *************** *** 149,154 **** --- 149,158 ---- switch ((*cond)->c_type) { /* Fast condition variable: */ case COND_TYPE_FAST: + /* Set the wakeup time: wait forever */ + _thread_run->wakeup_time.tv_sec = -1; + _thread_run->wakeup_time.tv_nsec = -1; + /* Queue the running thread for the condition variable:*/ _thread_queue_enq(&(*cond)->c_queue, _thread_run ); >Audit-Trail: >Unformatted: