Subject: lib/20139: pthread_cond_timedwait() problem
To: None <>
From: None <>
List: netbsd-bugs
Date: 01/31/2003 23:58:43
>Number:         20139
>Category:       lib
>Synopsis:       pthread_cond_timedwait() uses 100% CPU
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 31 15:59:02 PST 2003
>Originator:     Michael Graff
>Release:        NetBSD 1.6M
>Organization:  yes, we do know everything
System: NetBSD 1.6M NetBSD 1.6M (GENERIC.MP) #2: Fri Jan 31 12:22:55 PST 2003 i386
Architecture: i386
Machine: i386
When building glib on my dual AMD box, conftest locks up with 100% of

checking whether pthread_getspecific is posix like... yes
checking whether pthread_mutex_trylock is posix like... yes
checking whether pthread_cond_timedwait is posix like... ^Cspeedy# 

Put this in a file:
	#include <pthread.h>
	int main () { 
		pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
		pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
		struct timeval tval;
		struct timespec tspec;
		gettimeofday (&tval, NULL);
		tspec.tv_sec = tval.tv_sec;
		tspec.tv_nsec = 0;
		return pthread_cond_timedwait (&cond,&mutex,&tspec) != -1;

	cc -O2 -o conftest conftest.c -lpthread