pthread_cond_timedwait() broken in 9-stable? (from JAN 10)

David Xu listlog2011 at gmail.com
Sat Feb 18 05:47:10 UTC 2012


On 2012/2/18 9:30, Julian Elischer wrote:
>>
>
> mine is too, yet it still has problems..
> CPU: Intel(R) Xeon(R) CPU           E5420  @ 2.50GHz (2500.14-MHz 
> K8-class CPU)
>   Origin = "GenuineIntel"  Id = 0x10676  Family = 6  Model = 17  
> Stepping = 6
>   
> Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
>   
> Features2=0xce3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,DCA,SSE4.1>
>   AMD Features=0x20100800<SYSCALL,NX,LM>
>   AMD Features2=0x1<LAHF>
>   TSC: P-state invariant, performance statistics
> real memory  = 8589934592 (8192 MB)
> avail memory = 8214368256 (7833 MB)
> Event timer "LAPIC" quality 400
> ACPI APIC Table: <PTLTD          APIC >
> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
> FreeBSD/SMP: 1 package(s) x 4 core(s)
>  cpu0 (BSP): APIC ID:  0
>  cpu1 (AP): APIC ID:  1
>  cpu2 (AP): APIC ID:  2
>  cpu3 (AP): APIC ID:  3
> ioapic0 <Version 2.0> irqs 0-23 on motherboard
> ioapic1 <Version 2.0> irqs 24-47 on motherboard
>
>
Attached file is a small patch, don't know if it works for you, I can 
only find this at
the moment.

-------------- next part --------------
Index: src/lib/libthr/thread/thr_umtx.c
===================================================================
--- src/lib/libthr/thread/thr_umtx.c	(revision 231637)
+++ src/lib/libthr/thread/thr_umtx.c	(working copy)
@@ -205,7 +205,7 @@
 	if (abstime != NULL) {
 		clock_gettime(clockid, &ts);
 		TIMESPEC_SUB(&ts2, abstime, &ts);
-		if (ts2.tv_sec < 0 || ts2.tv_nsec <= 0)
+		if (ts2.tv_sec < 0 || (ts2.tv_sec == 0 && ts2.tv_nsec <= 0))
 			return (ETIMEDOUT);
 		tsp = &ts2;
 	} else {


More information about the freebsd-stable mailing list