summaryrefslogtreecommitdiffstats
path: root/bin/rm/rm.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2004-04-06 19:17:46 +0000
committerjhb <jhb@FreeBSD.org>2004-04-06 19:17:46 +0000
commit241908535b89498ae28f2dea48ae631b01dc6d28 (patch)
tree4a0a62119cab803f40317ae67cd3d91913ae1d00 /bin/rm/rm.c
parent7cf9a1d04483c8d713cf660b3184f87a848aaf68 (diff)
downloadFreeBSD-src-241908535b89498ae28f2dea48ae631b01dc6d28.zip
FreeBSD-src-241908535b89498ae28f2dea48ae631b01dc6d28.tar.gz
Associate a simple count of waiters with each condition variable. The
count is protected by the mutex that protects the condition, so the count does not require any extra locking or atomic operations. It serves as an optimization to avoid calling into the sleepqueue code at all if there are no waiters. Note that the count can get temporarily out of sync when threads sleeping on a condition variable time out or are aborted. However, it doesn't hurt to call the sleepqueue code for either a signal or a broadcast when there are no waiters, and the count is never out of sync in the opposite direction unless we have more than INT_MAX sleeping threads.
Diffstat (limited to 'bin/rm/rm.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud