Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85787 - trunk/boost/sync
From: tim_at_[hidden]
Date: 2013-09-19 05:00:23


Author: timblechmann
Date: 2013-09-19 05:00:23 EDT (Thu, 19 Sep 2013)
New Revision: 85787
URL: http://svn.boost.org/trac/boost/changeset/85787

Log:
sync: semaphore - use wording from ion's paper

Text files modified:
   trunk/boost/sync/semaphore.hpp | 10 +++++-----
   1 files changed, 5 insertions(+), 5 deletions(-)

Modified: trunk/boost/sync/semaphore.hpp
==============================================================================
--- trunk/boost/sync/semaphore.hpp Thu Sep 19 04:16:17 2013 (r85786)
+++ trunk/boost/sync/semaphore.hpp 2013-09-19 05:00:23 EDT (Thu, 19 Sep 2013) (r85787)
@@ -37,28 +37,28 @@
     semaphore& operator= (semaphore const&) = delete;
 
     /**
- * \b Effects: Increments the semaphore count. If a thread is waiting for this semaphore, it will be unblocked.
+ * \b Effects: Increments the semaphore count. If there are processes/threads blocked waiting for the semaphore, then one of these processes will return successfully from its wait function.
      *
      * \b Throws: if an error occurs.
      * */
     void post();
 
     /**
- * \b Effects: If the semaphore count is positive, it atomically decrements it and returns. Otherwise blocks the current thread, until it can successfully decrement a positive semaphore count.
+ * \b Effects: Decrements the semaphore. If the semaphore value is not greater than zero, then the calling process/thread blocks until it can decrement the counter.
      *
      * \b Throws: if an error occurs.
      * */
     void wait();
 
     /**
- * \b Effects: If the semaphore count is positive, it atomically decrements it and returns `true`. Otherwise `false`.
+ * \b Effects: Decrements the semaphore if the semaphore's value is greater than zero and returns true. If the value is not greater than zero returns false.
      *
      * \b Throws: if an error occurs.
      * */
     bool try_wait();
 
     /**
- * \b Effects: If the semaphore count is positive, it atomically decrements it and returns `true`. Otherwise it waits for the semaphore for `duration`.
+ * \b Effects: Decrements the semaphore if the semaphore's value is greater than zero and returns true. Otherwise, waits for the semaphore to the posted or the timeout expires. If the timeout expires, the function returns false. If the semaphore is posted the function returns true.
      *
      * \b Throws: if an error occurs.
      * */
@@ -66,7 +66,7 @@
     bool try_wait_for(const Duration & duration);
 
     /**
- * \b Effects: If the semaphore count is positive, it atomically decrements it and returns `true`. Otherwise it waits for the semaphore until `timeout`.
+ * \b Effects: Decrements the semaphore if the semaphore's value is greater than zero and returns true. Otherwise, waits for the semaphore to the posted or the timeout expires. If the timeout expires, the function returns false. If the semaphore is posted the function returns true.
      *
      * \b Throws: if an error occurs.
      * */


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk