|
Boost-Commit : |
From: bdawes_at_[hidden]
Date: 2007-12-12 18:16:50
Author: bemandawes
Date: 2007-12-12 18:16:50 EST (Wed, 12 Dec 2007)
New Revision: 41992
URL: http://svn.boost.org/trac/boost/changeset/41992
Log:
Resolved issues 4-7, 12, and 13. All dealt with aspects of what a thread object represents and how it is identified.
Text files modified:
sandbox/committee/LWG/issues.html | 17 +++++++----
sandbox/committee/LWG/thread_library.html | 57 +++++++++++++++++++--------------------
2 files changed, 38 insertions(+), 36 deletions(-)
Modified: sandbox/committee/LWG/issues.html
==============================================================================
--- sandbox/committee/LWG/issues.html (original)
+++ sandbox/committee/LWG/issues.html 2007-12-12 18:16:50 EST (Wed, 12 Dec 2007)
@@ -55,7 +55,7 @@
representing a thread of execution, and is transfered when
representation of a
thread of execution is transferred to a different thread object. </p>
-<p>4. [thread.threads.class] (30.2.1): "Objects of class thread may also
+<p>✔ 4. [thread.threads.class] (30.2.1): "Objects of class thread may also
represent not a thread." This doesn't really say anything. "Objects of
class
thread can be created that do not represent any thread of execution.
@@ -71,14 +71,14 @@
little more to say that such an id is unique, but I think this
approach makes
it cleaner. </p>
-<p>5. [thread.threads.id] (30.2.1.1): "... provides either a unique
+<p>✔ 5. [thread.threads.id] (30.2.1.1): "... provides either a unique
identity for
a thread of execution or a NAT value." See previous. But, if threads of
execution do not have id values in the absence of a corresponding thread
object, this is probably better phrased as "provides a unique
identifer for
each thread of execution and a distinct value for all NAT objects." </p>
-<p>6. [thread.threads.id] (30.2.1.1), id(): "The constructed object has
+<p>✔ 6a. [thread.threads.id] (30.2.1.1), id(): "The constructed object has
the NAT
value." Searching for NAT value shows that it's only used in one other
place,
@@ -86,14 +86,14 @@
and talk
everywhere about "a thread object that does not represent a thread of
execution." </p>
-<p>6. [thread.threads.id] (30.2.1.1), operator==: "If x and y represent
+<p>✔ 6b. [thread.threads.id] (30.2.1.1), operator==: "If x and y represent
the same
identity, returns true." "the same identity" doesn't mean anything.
"Returns
true only if x and y represent the same thread of execution or x and y
both do
not represent a thread of execution." </p>
-<p>7. [thread.threads.id] (30.2.1.1), operator<<: "Inserts an unspecified
+<p>✔ 7. [thread.threads.id] (30.2.1.1), operator<<: "Inserts an unspecified
text
representation of the thread::id into the stream out." Need to say that
distinct thread id's must have distinct representations. </p>
@@ -130,11 +130,14 @@
needn't say "The possible error conditions are implementation
defined." That's
covered in the front matter. Or should be. <g> </p>
-<p>12. [thread.threads.members] (30.2.1.5), get_id(): the returns clause is
+<p>✔ 12. [thread.threads.members] (30.2.1.5), get_id(): the returns clause is
confusing. I'd say "a default constructed id if *this does not
represent a
thread, otherwise this_thread::get_id()." </p>
-<p>13. [thread.threads.this] (30.2.2), get_id(): "uniquely identifies the
+<p><i>Changed that to "</i>otherwise this_thread::get_id() <u>for the thread of
+execution represented by <code>*this</code></u>.<i>" since that's the intended
+semantics."</i></p>
+<p>✔ 13. [thread.threads.this] (30.2.2), get_id(): "uniquely identifies the
current
thread of execution" doesn't seem adequate. There are two
requirements: no
Modified: sandbox/committee/LWG/thread_library.html
==============================================================================
--- sandbox/committee/LWG/thread_library.html (original)
+++ sandbox/committee/LWG/thread_library.html 2007-12-12 18:16:50 EST (Wed, 12 Dec 2007)
@@ -491,11 +491,15 @@
A <code>thread</code> object uniquely represents
a particular thread of execution
and the right to join with it.
-That right may be transfered to other thread objects.
+That right may be transferred to other thread objects.
A thread of execution is <dfn>detached</dfn>
when no <code>thread</code> object represents that thread.
-Objects of class <code>thread</code>
-may also represent <dfn>not a thread</dfn> (referred to as NAT).
+Objects of class <code>thread</code> can be in a state that does not represent a
+thread of execution.
+[<i>Note:</i> A <code>thread</code>
+object does not represent a thread of execution after default construction, or
+after a successful call to <code>detach</code> or <code>join</code>.
+—<i>end note</i>]
</p>
<blockquote>
@@ -562,14 +566,14 @@
</blockquote>
<p>
-An object of type <code>thread::id</code> provides either
-a unique identity for a thread of execution
-or a NAT value ([thread.threads.class]).
+An object of type <code>thread::id</code> provides a unique identifer for each
+thread of execution and a distinct value for all thread objects that do not
+represent a thread of execution ([thread.threads.class]).
Each thread of execution has a <code>thread::id</code>
that is not equal to the <code>thread::id</code>
of other threads of execution
-and that is not equal to the <code>thread::id</code>
-of NAT <code>std::thread</code> objects.
+and that is not equal to the <code>thread::id</code> of <code>std::thread</code> objects
+that do not represent threads of execution.
</p>
<p>
@@ -597,7 +601,7 @@
<dt>Postconditions:</dt>
<dd>
-The constructed object has the NAT value.
+The constructed object does not represent a thread.
</dd>
</dl>
</blockquote>
@@ -610,11 +614,9 @@
<dl>
<dt>Returns:</dt>
<dd>
-If <code><var>x</var></code> and <code><var>y</var></code>
-represent the same identity,
-returns <code>true</code>.
-Otherwise returns <code>false</code>.
-</dd>
+Returns <code>true</code> only if <code><var>x</var></code> and <code><var>y</var></code>
+represent the same thread of execution or neither <code><var>x</var></code> nor
+<code><var>y</var></code> represent a thread of execution.</dd>
<dt>Throws:</dt>
<dd>
@@ -725,8 +727,8 @@
<dt>Effects:</dt>
<dd>
Inserts an unspecified text representation of the <code>thread::id</code> into
-the stream <code>out</code>.
-</dd>
+the stream <code>out</code>. Distinct thread id's shall have distinct
+representations.</dd>
<dt>Returns:</dt>
<dd>
@@ -745,7 +747,8 @@
<dl>
<dt>Effects:</dt>
<dd>
-Constructs a <code>thread</code> object that represents NAT.
+Constructs a <code>thread</code> object that does not represent a thread of
+execution.
</dd>
<dt>Postconditions:</dt>
@@ -753,11 +756,6 @@
<code>get_id() == thread::id()</code>
<br>
<code>joinable() == false</code>
-<br>
-[<i>Note:</i>
-This is also the state of a <code>thread</code>
-object after <code>detach</code> or <code>join</code> is successfully called.
-—<i>end note</i>]
</dd>
<dt>Throws:</dt>
@@ -1060,11 +1058,10 @@
<dl>
<dt>Returns:</dt>
<dd>
-<code>this_thread::get_id()</code> for the thread
-represented by
-<code>*this</code>,
-or a default constructed <code>id</code>
-if <code>*this</code> does not represent a thread.
+A default constructed <code>id</code>
+if <code>*this</code> does not represent a thread, otherwise
+<code>this_thread::get_id()</code> for the thread of execution represented by
+<code>*this</code>.
</dd>
<dt>Throws:</dt>
@@ -1144,7 +1141,9 @@
<dt>Returns:</dt>
<dd>
An object of type <code>thread::id</code>
-that uniquely identifies the current thread of execution.
+that uniquely identifies the current thread of execution. No other thread of
+execution shall have this id and this thread of execution shall always have this
+id.
The object returned
shall not compare equal to a default constructed <code>thread::id</code>.
</dd>
@@ -5104,4 +5103,4 @@
</p>
</body>
-</html>
+</html>
\ No newline at end of file
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