summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2010-12-13 23:53:55 +0000
committermckusick <mckusick@FreeBSD.org>2010-12-13 23:53:55 +0000
commita8a33a7da0a8646d6e328a1036316fc2460583ef (patch)
tree8f7c1b95250ca08e559f4772011304b6984b3634
parentc050a4862ed6741d4ddea372c3aa1061691b2091 (diff)
downloadFreeBSD-src-a8a33a7da0a8646d6e328a1036316fc2460583ef.zip
FreeBSD-src-a8a33a7da0a8646d6e328a1036316fc2460583ef.tar.gz
Tighten up some of the comments describing turnstiles and sleepqueues.
No code changes. Reviewed by: John Baldwin
-rw-r--r--sys/sys/sleepqueue.h4
-rw-r--r--sys/sys/turnstile.h15
2 files changed, 10 insertions, 9 deletions
diff --git a/sys/sys/sleepqueue.h b/sys/sys/sleepqueue.h
index 3e33e6b..f2a5c75 100644
--- a/sys/sys/sleepqueue.h
+++ b/sys/sys/sleepqueue.h
@@ -49,7 +49,7 @@
* call sleepq_set_timeout() after sleepq_add() to setup a timeout. It
* should then use one of the sleepq_timedwait() functions to block.
*
- * If the thread wants to the sleep to be interruptible by signals, it can
+ * If the thread wants the sleep to be interruptible by signals, it can
* call sleepq_catch_signals() after sleepq_add(). It should then use
* one of the sleepq_wait_sig() functions to block. After the thread has
* been resumed, it should call sleepq_calc_signal_retval() to determine
@@ -68,7 +68,7 @@
* sleepq_signal(). These routines each return a boolean that will be true
* if at least one swapped-out thread was resumed. In that case, the caller
* is responsible for waking up the swapper by calling kick_proc0() after
- * releasing the sleep queeu chain lock.
+ * releasing the sleep queue chain lock.
*
* Each thread allocates a sleep queue at thread creation via sleepq_alloc()
* and releases it at thread destruction via sleepq_free(). Note that
diff --git a/sys/sys/turnstile.h b/sys/sys/turnstile.h
index ce48790..ffb44f4 100644
--- a/sys/sys/turnstile.h
+++ b/sys/sys/turnstile.h
@@ -39,13 +39,14 @@
* shared, or eread, lock, and one for threads waiting for an
* exclusive, or write, lock.
*
- * A thread calls turnstile_lock() to lock the turnstile chain associated
- * with a given lock. A thread calls turnstile_wait() when the lock is
- * contested to be put on the queue and block. If a thread needs to retry
- * a lock operation instead of blocking, it should call turnstile_release()
- * to unlock the associated turnstile chain lock.
+ * A thread calls turnstile_chain_lock() to lock the turnstile chain
+ * associated with a given lock. A thread calls turnstile_wait() when
+ * the lock is contested to be put on the queue and block. If a thread
+ * calls turnstile_trywait() and decides to retry a lock operation instead
+ * of blocking, it should call turnstile_cancel() to unlock the associated
+ * turnstile chain lock.
*
- * When a lock is released, the thread calls turnstile_lookup() to loop
+ * When a lock is released, the thread calls turnstile_lookup() to look
* up the turnstile associated with the given lock in the hash table. Then
* it calls either turnstile_signal() or turnstile_broadcast() to mark
* blocked threads for a pending wakeup. turnstile_signal() marks the
@@ -55,7 +56,7 @@
* releasing the lock, turnstile_unpend() must be called to wake up the
* pending thread(s) and give up ownership of the turnstile.
*
- * Alternatively, if a thread wishes to relinquish ownership of a thread
+ * Alternatively, if a thread wishes to relinquish ownership of a lock
* without waking up any waiters, it may call turnstile_disown().
*
* When a lock is acquired that already has at least one thread contested
OpenPOWER on IntegriCloud