threads: correct 'swap()' documentation
authorBrian Norris <banorris@uci.edu>
Fri, 10 Aug 2012 22:22:33 +0000 (15:22 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 16 Aug 2012 17:30:26 +0000 (10:30 -0700)
Some of the swap() documentation was duplicated incorrectly. While I'm at it,
make the descriptions more clear and precise.

threads.cc

index 7fa4281d36597db401dfb0b93da45f27f60a1ead..9b7954d9386b6f5390ed42a32b43a53f5f5f1ca7 100644 (file)
@@ -73,8 +73,9 @@ int Thread::create_context()
 /**
  * Swaps the current context to another thread of execution. This form switches
  * from a user Thread to a system context.
- * @param t Thread representing the current context
- * @param ctxt Context to switch to
+ * @param t Thread representing the currently-running thread. The current
+ * context is saved here.
+ * @param ctxt Context to which we will swap. Must hold a valid system context.
  * @return Does not return, unless we return to Thread t's context. See
  * swapcontext(3) (returns 0 for success, -1 for failure).
  */
@@ -86,9 +87,9 @@ int Thread::swap(Thread *t, ucontext_t *ctxt)
 /**
  * Swaps the current context to another thread of execution. This form switches
  * from a system context to a user Thread.
- * @param t Thread representing the current context
- * @param ctxt Context to switch to
- * @return Does not return, unless we return to Thread t's context. See
+ * @param ctxt System context variable to which to save the current context.
+ * @param t Thread to which we will swap. Must hold a valid user context.
+ * @return Does not return, unless we return to the system context (ctxt). See
  * swapcontext(3) (returns 0 for success, -1 for failure).
  */
 int Thread::swap(ucontext_t *ctxt, Thread *t)