PERFORCE change 68292 for review
David Xu
davidxu at FreeBSD.org
Tue Jan 4 21:14:04 PST 2005
http://perforce.freebsd.org/chv.cgi?CH=68292
Change 68292 by davidxu at davidxu_celeron on 2005/01/05 05:13:10
in trywait, replace `if' with `while'.
Affected files ...
.. //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_sem.c#5 edit
Differences ...
==== //depot/projects/davidxu_thread/src/lib/libthread/thread/thr_sem.c#5 (text+ko) ====
@@ -119,7 +119,7 @@
if ((*sem)->syssem != 0)
return (ksem_trywait((*sem)->semid));
- if ((val = (*sem)->count) > 0) {
+ while ((val = (*sem)->count) > 0) {
if (atomic_cmpset_acq_int(&(*sem)->count, val, val - 1))
return (0);
}
More information about the p4-projects
mailing list