From: Brian Norris Date: Fri, 10 Aug 2012 22:22:33 +0000 (-0700) Subject: threads: correct 'swap()' documentation X-Git-Tag: pldi2013~271^2~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=08b069a092910d66bab08096177d9f97461725e4;ds=sidebyside threads: correct 'swap()' documentation Some of the swap() documentation was duplicated incorrectly. While I'm at it, make the descriptions more clear and precise. --- diff --git a/threads.cc b/threads.cc index 7fa4281..9b7954d 100644 --- a/threads.cc +++ b/threads.cc @@ -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)