|
Boost-Commit : |
From: anthony_at_[hidden]
Date: 2007-12-03 10:10:31
Author: anthonyw
Date: 2007-12-03 10:10:31 EST (Mon, 03 Dec 2007)
New Revision: 41643
URL: http://svn.boost.org/trac/boost/changeset/41643
Log:
Updated wording for call_once
Text files modified:
sandbox/committee/LWG/thread_library.html | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
Modified: sandbox/committee/LWG/thread_library.html
==============================================================================
--- sandbox/committee/LWG/thread_library.html (original)
+++ sandbox/committee/LWG/thread_library.html 2007-12-03 10:10:31 EST (Mon, 03 Dec 2007)
@@ -80,7 +80,7 @@
<br> 30.2.4 Generic Locking Algorithms [thread.lock.algorithm]
<br> 30.2.5 Call Once [thread.mutex.once]
<br> 30.2.5.1 struct once_flag
[thread.mutex.onceflag]
-<br> 30.2.5.2 non-member function call_once
[thread.threads.callonce]
+<br> 30.2.5.2 Non-member function call_once
[thread.threads.callonce]
<br> 30.3 Condition variables [thread.condition]
<br> 30.3.1 Class condition_variable [thread.condvar]
<br> 30.3.2 Class condition_variable_any [thread.condvarany]
@@ -2552,12 +2552,11 @@
for the <code>once_flag</code> object specified by <code>flag</code>,
as-if by invoking <code>func(args)</code>,
even if <code>call_once</code> is called multiple times
-for the same <code>once_flag</code> object.
-If the invocation of <code>func</code> results in an exception being thrown,
+for the same <code>once_flag</code> object,
+except that if the invocation of <code>func</code> results in an exception being thrown,
the exception is propagated to the caller
-and the effects are as-if this invocation of <code>call_once</code>
+and the effects on <code>once_flag</code> are as-if this invocation of <code>call_once</code>
did not occur.
-<b>[Crowl: We cannot make this guarantee without transactions.]</b>
</dd>
<dt>Synchronization:</dt>
@@ -2577,10 +2576,14 @@
<dt>Thread safety:</dt>
<dd>
-<b>[Crowl: Reword?]</b>
-The implementation shall not introduce a data race or deadlock
-when different threads simultaneously use the same <code>once_flag</code> object
-to call <code>call_once</code>.
+If multiple threads invoke <code>call_once</code> concurrently with the same <code>once_flag</code> object, and that
+<code>once_flag</code> object has not already been used as a parameter to a successfully-completed invocation of
+<code>call_once</code>, then all but one of the threads shall block, and the remaining thread shall invoke the argument
+<code>func</code>. Once an invocation of <code>func</code> has completed in a non-exceptional manner, then any threads blocked on
+this <code>once_flag</code> object shall be unblocked.
+
+Use of <code>call_once</code> from one thread with one <code>once_flag</code> object shall not affect any invocations of
+<code>call_once</code> from any thread with a different <code>once_flag</code> object.
</dd>
</dl>
@@ -5507,4 +5510,4 @@
</p>
</body>
-</html>
\ No newline at end of file
+</html>
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