|
Boost-Commit : |
From: Lawrence_at_[hidden]
Date: 2007-10-23 01:18:36
Author: crowl
Date: 2007-10-23 01:18:36 EDT (Tue, 23 Oct 2007)
New Revision: 40337
URL: http://svn.boost.org/trac/boost/changeset/40337
Log:
Insert blank lines between block-level elements,
which is handy with editors that understand paragraphs.
Remove some empty paragraphs.
Text files modified:
sandbox/committee/LWG/thread_library.html | 460 +++++++++++++++++++++++++++++++++++++--
1 files changed, 432 insertions(+), 28 deletions(-)
Modified: sandbox/committee/LWG/thread_library.html
==============================================================================
--- sandbox/committee/LWG/thread_library.html (original)
+++ sandbox/committee/LWG/thread_library.html 2007-10-23 01:18:36 EDT (Tue, 23 Oct 2007)
@@ -332,6 +332,7 @@
operator<< (basic_ostream<charT, traits>&& out, const thread::id& id);
</code></pre>
+
<p>
Objects of type <code>thread::id</code> represent the identity of threads. Each
joinable thread has a unique identity. All non-joinable threads share the same
@@ -351,9 +352,11 @@
<p>
<i>Effects:</i> Constructs an object of type <code>id</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<p>
<i>Postcondition:</i> Represents the non-joinable identity.
</p>
@@ -371,6 +374,7 @@
<code><i>x</i></code> and <code><i>y</i></code> represent the same identity,
returns <code>true</code>. Otherwise returns <code>false</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -386,13 +390,13 @@
<p>
<i>Returns:</i> <code>!(<i>x</i> == <i>y</i>)</code>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
</blockquote>
</blockquote>
-
<blockquote>
<pre><code>
bool operator<(const thread::id& x, const thread::id& y);
@@ -402,6 +406,7 @@
<p>
<i>Returns:</i> a value such that <code>operator<</code> is a total ordering as described in [alg.sorting].
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -412,10 +417,12 @@
<pre><code>
bool operator<=(const thread::id& x, const thread::id& y);
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> <code>!(y < x)</code>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -426,10 +433,12 @@
<pre><code>
bool operator>(const thread::id& x, const thread::id& y);
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> <code>y < x</code>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -440,10 +449,12 @@
<pre><code>
bool operator>=(const thread::id& x, const thread::id& y);
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> <code>!(x < y)</code>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -462,6 +473,7 @@
<i>Effects:</i> Inserts an unspecified text representation of the <code>thread::id</code> into
the stream <code>out</code>.
</p>
+
<p>
<i>Returns:</i> <code>out</code>.
</p>
@@ -474,24 +486,29 @@
<pre><code>
thread();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Constructs a <code>thread</code> object that does not represent an
actual thread.
</p>
+
<p>
<i>Postconditions:</i>
</p>
+
<blockquote>
<pre><code>
get_id() == thread::id()
&& joinable() == false
</code></pre>
+
<p>
[<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>]
</p>
</blockquote>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -510,6 +527,7 @@
If <code>f</code> is an rvalue, <code>F</code> is <code>MoveConstructible</code>.
<b>[Crowl: Is this enforced by code?]</b>
</p>
+
<p>
<i>Effects:</i> Constructs an object of type <code>thread</code> and executes <code><i>INVOKE</i>(f, t1, t2, ..., tN)</code>
in a new thread, where <code>t1, t2,
@@ -518,18 +536,22 @@
If <code>f</code> terminates with an uncaught
exception, <code>std::terminate()</code> shall be called.
</p>
+
<p>
<i>Postconditions:</i>
</p>
+
<blockquote>
<pre><code>
get_id() != thread::id()
&& joinable() == true
</code></pre>
+
<p>
<code>*this</code> represents the newly started thread.
</p>
</blockquote>
+
<p>
<i>Throws:</i> <code>system_error</code> if unable to start the new thread.
</p>
@@ -545,6 +567,7 @@
<p>
<i>Effects:</i> Constructs an object of type <code>thread</code> from <code><i>x</i></code>.
</p>
+
<p>
<i>Postconditions:</i> <code><i>x</i>.joinable()</code> is <code>false</code>.
<code><i>x</i>.get_id() == thread().get_id()</code>. <code>joinable()</code>
@@ -552,6 +575,7 @@
<code>get_id()</code> returns the value of <code><i>x</i>.get_id()</code> prior to the
start of construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -570,6 +594,7 @@
<i>Effects:</i> If <code>joinable()</code> then <code>detach()</code>,
otherwise no effects.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -589,6 +614,7 @@
<code>detach()</code>. Then assigns the state of <code><i>x</i></code> to <code>*this</code>
and sets <code><i>x</i></code> to a default constructed state.
</p>
+
<p>
<i>Postconditions:</i> <code><i>x</i>.joinable()</code> is <code>false</code>.
<code><i>x</i>.get_id() == thread().get_id()</code>. <code>joinable()</code> returns the
@@ -597,6 +623,7 @@
<code>get_id()</code> returns the value of <code><i>x</i>.get_id()</code> prior to the
assignment.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -614,6 +641,7 @@
<p>
<i>Effects:</i> Swaps the state of <code>*this</code> and <code><i>x</i></code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -629,6 +657,7 @@
<p>
<i>Returns:</i> <code>get_id() != id()</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -644,6 +673,7 @@
<p>
<i>Preconditions:</i> <code>joinable()</code> is <code>true</code>.
</p>
+
<p>
<i>Effects:</i> The current thread blocks until the thread
represented by <code>*this</code> completes.
@@ -651,6 +681,7 @@
on a memory location that the joiner does an acquire on.
I.e. there is a happens before relationship.]</b>
</p>
+
<p>
<i>Postconditions:</i> After a normal return of <code>join()</code>,
<code>joinable()</code> is <code>false</code>. If <code>join()</code> throws an exception, the thread represented by
@@ -673,6 +704,7 @@
<p>
<i>Preconditions:</i> <code>joinable()</code> is <code>true</code>.
</p>
+
<p>
<i>Effects:</i> The thread represented by
<code>*this</code> continues execution. When the thread represented by
@@ -680,10 +712,12 @@
<b>[Crowl: The programmer shall or the implementation shall?
Which resources?]</b>
</p>
+
<p>
<i>Postconditions:</i> <code>joinable()</code> is <code>false</code>. <code>*this</code>
does not represent a thread.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -702,6 +736,7 @@
represented by
<code>*this.</code>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -722,6 +757,7 @@
<i>--end note]</i> If this value is not computable or well defined a
return value of 1 is recommended, but not required.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -736,6 +772,7 @@
void swap(thread&& x, thread& y);
void swap(thread& x, thread&& y);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> <code>x.swap(y)</code>.
@@ -772,6 +809,7 @@
and does not compare equal to a default constructed <code>thread::id</code>, else returns
a default constructed <code>thread::id</code>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -787,6 +825,7 @@
<p>
<i>Effects:</i> Offers the operating system the opportunity to schedule another thread.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -803,9 +842,11 @@
<p>
<i>Requires:</i> <code>Duration</code> shall be explicitly convertible to <code>nanoseconds</code>.
</p>
+
<p>
<i>Effects:</i> The current thread blocks for at least the amount of time specified.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -815,7 +856,6 @@
<h4><code>struct once_flag</code></h4>
<blockquote>
-
<p>
Objects of class <code>once_flag</code> are opaque data structures that allow
<code>call_once</code> to initialize data without causing a data race or
@@ -831,6 +871,7 @@
<i>Effects:</i> Constructs a object of type
<code>once_flag</code>.
</p>
+
<p>
<i>Postcondition:</i> Internal state is set to indicate to an invocation
of <code>call_once</code> with this <code>once_flag</code> as its initial
@@ -843,14 +884,12 @@
<h4><code>non-member function call_once</code></h4>
<blockquote>
-
<pre><code>
template<class Callable, class Args...>
void call_once(once_flag& flag, Callable func, Args&&... args);
</code></pre>
<blockquote>
-
<p>
<i>Requires:</i> If <code>func</code> is an lvalue, Callable
is
@@ -888,6 +927,7 @@
<p>
[<i>Examples:</i>
</p>
+
<blockquote>
<pre><code>
std::once_flag flag;
@@ -982,19 +1022,23 @@
<pre><code>
void lock();
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> For non-recursive mutexes the current thread shall not own the mutex.
</p>
+
<p>
<i>Effects:</i> The current thread will block until the mutex is not owned by another thread.
<b>[Crowl: I.e. happens before?]</b>
Upon successful completion, the current thread owns the mutex.
</p>
+
<p>
<i>Throws:</i> <code>system_error</code> when an error condition occurs. The
possible error conditions are implementation defined.
</p>
+
<p>
<i>Thread safety:</i> This is an acquire operation.
</p>
@@ -1005,10 +1049,12 @@
<pre><code>
bool try_lock();
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> For non-recursive mutexes the current thread shall not own the mutex.
</p>
+
<p>
<i>Effects:</i>
If ownership can be obtained without blocking,
@@ -1024,14 +1070,16 @@
And such a guarantee would preclude potentially interesting
<code>try_lock()</code> implementations based on <code>compare_swap</code>.
— <i>end note</i>]
-
</p>
+
<p>
<i>Returns:</i> <code>true</code> if ownership was obtained, otherwise <code>false</code>.
</p>
+
<p>
<i>Thread safety:</i> This is an acquire operation if <code>try_lock</code> returns <code>true</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1042,18 +1090,22 @@
<pre><code>
void unlock();
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> The current thread shall own the mutex.
</p>
+
<p>
<i>Effects:</i> For a non-recursive mutex ownership is released. For a recursive mutex
<code>unlock()</code> must be called the same number of times which the mutex was locked
(via either <code>lock()</code> or <code>try_lock()</code> or by any other locking function) before ownership is released.
</p>
+
<p>
<i>Thread safety:</i> This is a release operation.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1136,12 +1188,14 @@
template <class Duration>
bool timed_lock(const Duration& rel_time);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> For non-recursive mutexes the current thread shall not own
the mutex. .
<b>[Crowl: Roundup here instead of under various locks.]</b>
</p>
+
<p>
<i>Effects:</i>
The function attempts to obtain ownership of the mutex
@@ -1158,13 +1212,16 @@
but implementations are expected to make a strong effort to do so.
— <i>end note</i>]
</p>
+
<p>
<i>Returns:</i> <code>true</code> if ownership was obtained, otherwise <code>false</code>.
</p>
+
<p>
<i>Thread safety:</i> This is a synchronization operation.
<b>[Crowl: on the memory locations of the lock.]</b>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1318,12 +1375,14 @@
<pre><code>
explicit lock_guard(mutex_type& m);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> If <code>mutex_type</code> is not a recursive mutex, the current thread
does not own the mutex. The lifetime of <code><i>m</i></code> includes the lifetime
of the <code>lock_guard</code> object.
</p>
+
<p>
<i>Effects:</i> Stores a reference to <code><i>m</i></code> and calls <code><i>m</i>.lock()</code>.
<b>[Crowl: An acquire specification is not necessary because of m.lock().]</b>
@@ -1335,12 +1394,14 @@
<pre><code>
lock_guard(mutex_type& m, adopt_lock_t);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> The current thread has ownership of the mutex <code><i>m</i></code>.
The lifetime of <code><i>m</i></code> includes the lifetime of the <code>
lock_guard</code> object.
</p>
+
<p>
<i>Effects:</i> Stores a reference to <code><i>m</i></code> and performs no other operation on it.
</p>
@@ -1351,10 +1412,12 @@
<pre><code>
~lock_guard();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> <code><i>m</i>.unlock()</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1422,13 +1485,16 @@
<pre><code>
unique_lock();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Constructs an object of type <code>unique_lock</code>.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == 0
@@ -1442,18 +1508,22 @@
<pre><code>
explicit unique_lock(mutex_type& m);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> If <code>mutex_type</code> is not a recursive mutex, the current thread
does not own the mutex. The lifetime of <code><i>m</i></code> includes the lifetime
of the <code>unique_lock</code> object.
</p>
+
<p>
<i>Effects:</i> Stores a reference to <code><i>m</i></code> and calls <code><i>m</i>.lock()</code>.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == &m
@@ -1467,6 +1537,7 @@
<pre><code>
unique_lock(mutex_type& m, defer_lock_t);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> If <code>mutex_type</code> is not a recursive mutex, the current thread
@@ -1474,12 +1545,15 @@
The lifetime of <code><i>m</i></code> includes the lifetime of the <code>
unique_lock</code> object.
</p>
+
<p>
<i>Effects:</i> Stores a reference to <code><i>m</i></code> and performs no other operation on it.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == &m
@@ -1493,6 +1567,7 @@
<pre><code>
unique_lock(mutex_type& m, try_to_lock_t);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> If <code>mutex_type</code> is not a recursive mutex, then the current thread
@@ -1500,12 +1575,15 @@
The lifetime of <code><i>m</i></code> includes the lifetime of the <code>
unique_lock</code> object.
</p>
+
<p>
<i>Effects:</i> Stores a reference to <code><i>m</i></code> and calls <code><i>m</i>.try_lock()</code>.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == &m
@@ -1519,18 +1597,22 @@
<pre><code>
unique_lock(mutex_type& m, adopt_lock_t);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> The current thread has ownership of the mutex <code><i>m</i></code>.
The lifetime of <code><i>m</i></code> includes the lifetime of the <code>
unique_lock</code> object.
</p>
+
<p>
<i>Effects:</i> Stores a reference to <code><i>m</i></code> and performs no other operation on it.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == &m
@@ -1544,11 +1626,13 @@
<pre><code>
~unique_lock();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> If <code>owns_lock()</code> calls <code>unlock()</code> on the referenced mutex.
Otherwise there are no effects.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1559,13 +1643,16 @@
<pre><code>
unique_lock(unique_lock&& u);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Transfers mutex ownership (if any) from <code>u</code> to <code>this</code>.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == <i>The value of</i> u.mutex() <i>prior to the construction</i>.
@@ -1574,6 +1661,7 @@
u.owns_lock() == false
</code></pre>
</blockquote>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1584,14 +1672,17 @@
<pre><code>
unique_lock& operator=(unique_lock&& u);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> If <code>owns_lock()</code> calls <code>unlock()</code>, and then
transfers mutex ownership (if any) from <code>u</code> to <code>this</code>.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == <i>The value of</i> u.mutex() <i>prior to the construction</i>.
@@ -1600,9 +1691,11 @@
u.owns_lock() == false
</code></pre>
</blockquote>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<p>
<i>Note:</i> With a recursive mutex it is possible that both
<code>this</code> and <code>u</code> own the same mutex before the assignment.
@@ -1617,13 +1710,16 @@
<pre><code>
void lock();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Calls <code>lock()</code> on the referenced mutex.
</p>
+
<p>
<i>Postcondition:</i> <code>owns_lock() == true</code>.
</p>
+
<p>
<i>Throws:</i> <code>lock_error</code>, if on entry <code>owns_lock()</code> is <code>true</code>.
</p>
@@ -1634,16 +1730,20 @@
<pre><code>
bool try_lock();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Calls <code>try_lock()</code> on the referenced mutex.
</p>
+
<p>
<i>Returns:</i> The result of the call to <code>try_lock()</code> on the referenced mutex.
</p>
+
<p>
<i>Postcondition:</i> <code>owns_lock() == </code>The result of the call to <code>try_lock()</code> on the referenced mutex.
</p>
+
<p>
<i>Throws:</i> <code>lock_error</code>, if on entry <code>owns_lock()</code> is <code>true</code>.<code> </code>
</p>
@@ -1655,18 +1755,22 @@
template <class Duration>
bool timed_lock(const Duration& rel_t);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Calls <code>timed_lock(rel_t)</code> on the referenced mutex.
If the resolution of Duration is greater <b>[Crowl: less]</b> than the native
resolution the time is rounded up to the nearest native resolution.
</p>
+
<p>
<i>Returns:</i> The result of the call to <code>timed_lock(rel_t)</code> on the referenced mutex.
</p>
+
<p>
<i>Postcondition:</i> <code>owns_lock() == </code>The result of the call to <code>timed_lock(rel_t)</code> on the referenced mutex.
</p>
+
<p>
<i>Throws:</i> <code>lock_error</code>, if on entry <code>owns_lock()</code> is <code>true</code>.
</p>
@@ -1677,13 +1781,16 @@
<pre><code>
void unlock();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Calls <code>unlock()</code> on the referenced mutex.
</p>
+
<p>
<i>Postcondition:</i> <code>owns_lock() == false</code>.
</p>
+
<p>
<i>Throws:</i> <code>lock_error</code>, if on entry <code>owns_lock()</code> is <code>false</code>.
</p>
@@ -1694,10 +1801,12 @@
<pre><code>
bool owns_lock() const;
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> <code>true</code> if <code>this</code> owns a lock on a referenced mutex, else <code>false</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1708,10 +1817,12 @@
<pre><code>
operator <var>unspecified-bool-type</var> () const;
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> Non-null if <code>owns_lock()</code> would return <code>true</code>, else returns null.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1722,10 +1833,12 @@
<pre><code>
mutex_type* mutex() const;
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> A pointer to the referenced mutex, or null if there is no referenced mutex.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1736,10 +1849,12 @@
<pre><code>
void swap(unique_lock&& u);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Swaps state with <code>u</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1750,19 +1865,23 @@
<pre><code>
mutex_type* release();
</code></pre>
+
<blockquote>
<p>
<i>Returns:</i> A pointer to the referenced mutex, or null if there is no referenced mutex.
</p>
+
<p>
<i>Postcondition:</i>
</p>
+
<blockquote>
<pre><code>
mutex() == 0
owns_lock() == false
</code></pre>
</blockquote>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1775,10 +1894,12 @@
template <class Mutex> void swap(unique_lock<Mutex>&& x, unique_lock<Mutex>& y);
template <class Mutex> void swap(unique_lock<Mutex>& x, unique_lock<Mutex>&& y);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> <code>x.swap(y)</code>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1791,6 +1912,7 @@
<pre><code>
template <class L1, class L2, class ...L3> int try_lock(L1&, L2&, L3&...);
</code></pre>
+
<blockquote>
<p>
<i>Requires:</i> Each template parameter type must supply the following member functions with semantics
@@ -1798,18 +1920,21 @@
exception. <i>[Note:</i> The <code>unique_lock</code> class template meets these requirements
when suitable instantiated. <i>--end note]</i>
</p>
+
<blockquote>
<pre><code>
bool try_lock();
void unlock();
</code></pre>
</blockquote>
+
<p>
<i>Effects:</i> The functions attempts to lock all arguments without blocking by calling <code>try_lock()</code>
on each of them. If any argument can not be locked, then all arguments which have already been locked will
be unlocked. On return, either all arguments will be locked, or none of them will be locked. If an
exception is thrown by a call to <code>try_lock()</code>, there are no effects.
</p>
+
<p>
<i>Returns:</i> If all arguments were successfully locked, returns <code>-1</code>. Otherwise returns a 0-based index
value indicating
@@ -1822,6 +1947,7 @@
<pre><code>
template <class L1, class L2, class ...L3> void lock(L1&, L2&, L3&...);
</code></pre>
+
<blockquote>
<p>
<i>Requires:</i> Each template parameter type must supply the following member functions with semantics
@@ -1829,6 +1955,7 @@
throw an exception <i>[Note:</i> The <code>unique_lock</code> class template meets these requirements
when suitable instantiated. <i>--end note]</i>
</p>
+
<blockquote>
<pre><code>
void lock();
@@ -1836,6 +1963,7 @@
void unlock();
</code></pre>
</blockquote>
+
<p>
<i>Effects:</i> All arguments are locked with an algorithm that avoids deadlock.
If an exception is thrown by a call to <code>lock()</code> or <code>try_lock()</code>, there are no effects.
@@ -1903,6 +2031,7 @@
<pre><code>
condition_variable();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Constructs an object of class <code>condition_variable</code>.
@@ -1914,10 +2043,12 @@
<pre><code>
~condition_variable();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Destroys the object.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -1928,14 +2059,18 @@
<pre><code>
void notify_one();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> If any threads are blocked waiting for <code>*this</code>,
unblocks at least one those threads.
<b>[Crowl: Is any lock released?]</b>
</p>
+
<p>
<b>[Crowl: Needs to say release operation.]</b>
+</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -1950,11 +2085,13 @@
<pre><code>
void notify_all();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Unblock all threads that are blocked waiting for <code>*this</code>.
<b>[Crowl: Needs to say release operation.]</b>
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -1969,12 +2106,14 @@
<pre><code>
void wait(unique_lock<mutex>& lock);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> <code>lock</code> is locked by the current thread. No
other thread is waiting on this <code>condition_variable</code> object unless <code>lock</code>
refers to the same underlying <code>mutex</code> object.
</p>
+
<p>
<i>Effects:</i> Atomically blocks and releases the lock on
<code>lock</code>. If the <code>wait</code> throws an exception, <code>lock</code> will be
@@ -1982,14 +2121,17 @@
unblock and return even in the absence of a notification.
<b>[Crowl: Needs to say acquire operation.]</b>
</p>
+
<p>
<i>Postcondition:</i> <code>lock</code> is locked by the current
thread.
</p>
+
<p>
<i>Throws:</i> <span style="font-style: italic; background-color: #FFFF00">???
See issue 26</span>
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -2005,10 +2147,12 @@
template <class Predicate>
void wait(unique_lock<mutex>& lock, Predicate pred);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> While <code>pred()</code> returns <code>false</code> calls <code>wait(lock)</code>.
</p>
+
<p>
<i>[Note:</i> Does not block if <code>pred()</code> is initially <code>true</code>. <i>
--end note</i>]
@@ -2016,17 +2160,18 @@
</blockquote>
</blockquote>
-
<blockquote>
<pre><code>
bool timed_wait(unique_lock<mutex>& lock, const system_time& abs_time);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> The <code>lock</code> is locked by the current thread. No
other thread is waiting on this <code>condition_variable</code> object unless <code>lock</code>
refers to, the same underlying <code>mutex</code> object.
</p>
+
<p>
<i>Effects:</i> Atomically blocks and releases the lock on
<code>lock</code>. If the <code>timed_wait</code> should throw an exception for
@@ -2040,19 +2185,23 @@
thread may unblock and return even in the absence of a
notification.
</p>
+
<p>
<i>Postcondition:</i> <code>lock</code> is locked by the current
thread.
</p>
+
<p>
<i>Returns:</i> <code>true</code> if the call to <code>timed_wait</code> is notified prior
to the indicated timeout,
otherwise returns <code>false</code>.
</p>
+
<p>
<i>Throws:</i> <span style="font-style: italic; background-color: #FFFF00">???
See issue 26</span>
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -2070,10 +2219,12 @@
template <class Predicate>
bool timed_wait(unique_lock<mutex>& lock, const system_time& abs_time, Predicate pred);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> As if:
</p>
+
<blockquote>
<pre><code>
while (!pred())
@@ -2084,9 +2235,11 @@
return true;
</code></pre>
</blockquote>
+
<p>
<i>Returns:</i> <code>pred()</code>.
</p>
+
<p>
<i>Note:</i> There is no blocking if <code>pred()</code> is initially <code>true</code>, even
if the timeout has already expired. The return value indicates whether the predicate
@@ -2095,7 +2248,6 @@
</blockquote>
</blockquote>
-
<p>
<code>condition_variable</code> shall be a standard-layout class (chapter 9 [class]).
</p>
@@ -2150,6 +2302,7 @@
<pre><code>
condition_variable_any();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Constructs an object of class <code>condition_variable_any</code>.
@@ -2161,10 +2314,12 @@
<pre><code>
~condition_variable_any();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Destroys the object.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -2175,11 +2330,13 @@
<pre><code>
void notify_one();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> If any threads are blocked waiting for <code>*this</code>,
unblocks at least one those threads.
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -2194,10 +2351,12 @@
<pre><code>
void notify_all();
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> Unblock all threads of execution that are blocked waiting for <code>*this</code>.
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -2212,6 +2371,7 @@
<pre><code>
void wait(Lock& lock);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> <code>lock</code> is locked by the current thread. If
@@ -2219,6 +2379,7 @@
other thread is waiting on this <code>condition_variable_any</code> object unless <code>lock</code>
is, or refers to, the same underlying mutex object.
</p>
+
<p>
<i>Effects:</i> Atomically blocks and releases the lock on
<code>lock</code>. If the <code>wait</code> should throw an exception for any
@@ -2227,14 +2388,17 @@
notification to this blocked thread. The current thread may
unblock and return even in the absence of a notification.
</p>
+
<p>
<i>Postcondition:</i> <code>lock</code> is locked by the current
thread.
</p>
+
<p>
<i>Throws:</i> <code>system_error</code> when an error condition occurs. The
possible error conditions are implementation defined.
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -2250,21 +2414,23 @@
template <class Predicate>
void wait(lock_type& lock, Predicate pred);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> While <code>pred()</code> returns <code>false</code>, calls <code>wait(lock)</code>.
</p>
+
<p>
<i>Note:</i> There is no blocking if <code>pred()</code> is initially <code>true</code>.
</p>
</blockquote>
</blockquote>
-
<blockquote>
<pre><code>
bool timed_wait(Lock& lock, const system_time& abs_time);
</code></pre>
+
<blockquote>
<p>
<i>Precondition:</i> The <code>lock</code> is locked by the current thread. If
@@ -2272,6 +2438,7 @@
other thread is waiting on this <code>condition_variable_any</code> object unless <code>lock</code>
is, or refers to, the same underlying mutex object.
</p>
+
<p>
<i>Effects:</i> Atomically blocks and releases the lock on
<code>lock</code>. If the <code>timed_wait</code> should throw an exception for
@@ -2285,19 +2452,23 @@
thread may unblock and return even in the absence of a
notification.
</p>
+
<p>
<i>Postcondition:</i> <code>lock</code> is locked by the current
thread.
</p>
+
<p>
<i>Returns:</i> <code>true</code> if the call to <code>timed_wait</code> is notified prior
to the indicated timeout,
otherwise returns <code>false</code>.
</p>
+
<p>
<i>Throws:</i> <code>system_error</code> when an error condition occurs. The
possible error conditions are implementation defined.
</p>
+
<p>
<i>Thread safety:</i> Calls to the <code>wait</code>,
<code>timed_wait</code>, <code>notify_one</code> or
@@ -2313,10 +2484,12 @@
template <class _Predicate>
bool timed_wait(Lock& lock, const system_time& abs_time, Predicate pred);
</code></pre>
+
<blockquote>
<p>
<i>Effects:</i> As if:
</p>
+
<blockquote>
<pre><code>
while (!pred())
@@ -2327,9 +2500,11 @@
return true;
</code></pre>
</blockquote>
+
<p>
<i>Returns:</i> <code>pred()</code>.
</p>
+
<p>
<i>Note:</i> There is no blocking if <code>pred()</code> is initially <code>true</code>, even
if the timeout has already expired. The return value indicates whether the predicate
@@ -2353,7 +2528,6 @@
have an <i>epoch</i> or start of a given time scale. For time_t the epoch is
1970-01-01 00:00:00.
-
<p>
Throughout this clause, the names of template parameters are used to express
type requirements. <span style="background-color: #FFFF00">Define Duration,
@@ -2388,19 +2562,18 @@
<h3 class="title"><a name="n2411_07_0271___proposal_for_date_time_types_in_c__0x_to_support_threading_apis_v2.proposed_text.class_utc_time"></a>class system_time</h3>
-
<p>
The class <code>system_time</code> provides a time point that represents the current
Coordinated Universal Time, known as UTC, time.
<code>system_time</code> shall provide an epoch time of 1970-01-01 00:00:00.000000000
and a maximum time value of at least epoch time + 292 years.
</p>
+
<p>
class <code>system_time</code> shall be EqualityComparable, LessThanComparable,
CopyConstructable, DefaultConstructable, and Assignable.
</p>
-
<blockquote>
<pre><code>
class system_time
@@ -2459,201 +2632,257 @@
<pre><code>
<span class="identifier">system_time</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Effects:</i> Constructs a system_time
object representing the epoch time point 1970-01-01 00:00:00.000000000
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">system_time</span><span class="special">(</span><span class="identifier">time_t</span> <span class="identifier">secs</span><span class="special">,</span> <span class="identifier">nanoseconds</span> <span class="identifier">ns</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Construct<span class="underline">s</span> a utc
time object representing the time point that is secs + 1,000,000,000*ns after the epoch.
</p>
+
<p>
<i>Remarks:</i> If the total nanoseconds > 1 second the seconds are
incremented appropriately.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
-<p>
-</p>
+
<pre><code>
<span class="identifier">time_t</span> <span class="identifier">seconds_since_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> The count of seconds since 1970-01-01 00:00:00.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">nanoseconds</span> <span class="identifier">nanoseconds_since_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> The count of <span class="underline">nano</span>seconds
since 1970-01-01 00:00:00.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 1000000000
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 0
</p>
+
<p>
<i>Remarks:</i> Since this is a subsecond type it returns 0 for seconds_per_tick.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> true.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if
the <span class="underline">time
represented by *this is equal to the time represented by rhs</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if the <span class="underline">time represented by *this is not equal to the time represented
by rhs</span>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if time <span class="underline">represented by
*this is greater than the time represented by rhs</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if time <span class="underline">represented
by *this is greater or equal than the time represented by rhs</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if time <span class="underline">represented by *this
is less than the time represented by rhs</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if time <span class="underline">represented by *this
is less or equal than the time represented by rhs</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">nanoseconds</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">system_time</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> <span class="underline">
The difference in nanoseconds between the time represented by *this and the
time represented by rhs.</span>
</p>
+
<p>
<i>Remarks:</i> If rhs is greater the result will be a negative nanosecond.
count.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Duration</span><span class="special">></span>
<span class="identifier">system_time</span> <span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">Duration</span><span class="special">&</span> <span class="identifier">td</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> The duration converted to nanosecond resolution
and added to the time <span class="underline">represented by *this</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Duration</span><span class="special">></span>
<span class="identifier">system_time</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">Duration</span><span class="special">&</span> <span class="identifier">td</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Convert the duration to nanosecond resolution add to nanoseconds
to the time represented by *this.
</p>
+
<p>
<i>Returns:</i> Modified value of this.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Duration</span><span class="special">></span>
<span class="identifier">system_time</span> <span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <span class="identifier">Duration</span><span class="special">&</span> <span class="identifier">td</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> The duration converted to nanosecond resolution
and subtracted from the time <span class="underline">represented by *this</span>.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Duration</span><span class="special">></span>
<span class="identifier">system_time</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">Duration</span><span class="special">&</span> <span class="identifier">td</span><span class="special">)</span>
</code></pre>
+
<p>
<i>Effects:</i> Convert the duration to nanosecond resolution subtract and
from the time represented by *this.
</p>
+
<p>
<i>Returns:</i> Modified value of this.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -2666,7 +2895,6 @@
resolution up to nanoseconds. The actual resolution may vary from platform to platform.
</p>
-
<blockquote>
<pre><code>
system_time get_system_time();
@@ -2691,16 +2919,17 @@
functions provide the basis for durations to be EqualityComparable, LessThanComparable
as well arithmetic operations.
</p>
+
<p>
In the following text duration_type refers to the containing duration type.
</p>
+
<p>
All duration types are EqualityComparable, LessThanComparable,
CopyConstructable, DefaultConstructable, and Assignable for duration
objects of the same type.
</p>
-
<blockquote>
<pre><code>
class Duration {
@@ -2751,196 +2980,250 @@
}
</code></pre>
</blockquote>
-<p>
-</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if rhs duration is greater.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if rhs is not the same time.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if the rhs duration is larger.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if greater or equal than the rhs duration.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if less than the rhs duration.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
</code></pre>
+
<p>
<i>Returns:</i> True if less or equal to the rhs duration.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="comment">//sign inversion
</span><span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> Negated value of the duration.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="comment">//arithmetic operations
</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">-</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> A duration value equal to this-rhs_duration.
</p>
+
<p>
<span class="emphasis"><em>Remarks: This will fail to compiler if the
RhsDuration is
of higher resolution.</em></span>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span>
</code></pre>
+
<p>
<i>Effects:</i> Modifies to value equal to this-rhs_duration.
</p>
+
<p>
<i>Returns:</i> this
</p>
+
<p>
<span class="emphasis"><em>Remarks: This will fail to compiler if the
RhsDuration is
of higher resolution.</em></span>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">+</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> Duration equal to this+rhs_duration.
</p>
+
<p>
<span class="emphasis"><em>Remarks: This will fail to compiler if the
RhsDuration is
of higher resolution.</em></span>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">RhsDuration</span><span class="special">></span>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">RhsDuration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span>
</code></pre>
+
<p>
<i>Effects:</i> Modifies to value equal to this+rhs_duration.
</p>
+
<p>
<i>Returns:</i> this
</p>
+
<p>
<span class="emphasis"><em>Remarks: This will fail to compiler if the
RhsDuration is
of higher resolution.</em></span>
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">/</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">divisor</span><span class="special">)</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> Duration with value equal to this/divisor according to
integer arithmetic rules.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">int</span> <span class="identifier">divisor</span><span class="special">)</span>
</code></pre>
+
<p>
<i>Effects:</i> Change value of this by this/divisor according to integer
arithmetic rules.
</p>
+
<p>
<i>Returns:</i> this
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">*</span> <span class="special">(</span><span class="keyword">int</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> Duration with value equal to this*rhs
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">Duration</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">int</span> <span class="identifier">rhs</span><span class="special">)</span>
</code></pre>
+
<p>
<i>Effects:</i> Modifies to value equal to this*rhs.
</p>
+
<p>
<i>Returns:</i> this
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">tick_type</span> <span class="identifier">get_count</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> The count at the resolution of the time duration
type.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -2976,48 +3259,60 @@
<pre><code>
<span class="identifier">nanoseconds</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Constructs an object with a count of nanoseconds - default
is zero.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">nanoseconds</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">nanoseconds</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Copy construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
-<p>
-</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 1000000000
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 0
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> true
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -3057,65 +3352,79 @@
<pre><code>
<span class="identifier">microseconds</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Constructs an object with a count of microseconds - default
is zero.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">microseconds</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">microseconds</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Copy construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
-<p>
-</p>
+
<pre><code>
<span class="comment">//conversions
</span><span class="keyword">operator</span> <span class="identifier">nanoseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> microsecond count converted to nanoseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 1000000
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 0
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> true
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
<h3 class="title"><a name="n2411_07_0271___proposal_for_date_time_types_in_c__0x_to_support_threading_apis_v2.proposed_text.class_milliseconds"></a>class milliseconds</h3>
-
<p>
Objects of class <code>milliseconds</code> can be used to represent a count of milliseconds.
</p>
@@ -3147,66 +3456,84 @@
<pre><code>
<span class="identifier">milliseconds</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Constructs an object with a count of milliseconds - default
is zero.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">milliseconds</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">milliseconds</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Copy construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
-<p>
-</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">nanoseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> millisecond count converted to nanoseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">microseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> millisecond count converted to microseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 1000
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 0
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> true
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -3246,82 +3573,102 @@
<pre><code>
<span class="identifier">seconds</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Construct<span class="underline">s</span> a<span class="underline">n object with a</span> count of seconds - default is
zero.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">seconds</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">seconds</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Copy construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
-<p>
-</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">nanoseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> second count converted to nanoseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">microseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> second count converted to microseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">milliseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> second count converted to milliseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 1
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 1
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> false
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
<h3 class="title"><a name="n2411_07_0271___proposal_for_date_time_types_in_c__0x_to_support_threading_apis_v2.proposed_text.class_minutes"></a>class minutes</h3>
-
<p>
Objects of class <code>minutes</code> can be used to represent a count of minutes.
</p>
@@ -3352,87 +3699,115 @@
};
</code></pre>
</blockquote>
+
<pre><code>
<span class="identifier">minutes</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Construct<span class="underline">s</span> a<span class="underline">n object with a</span> count of minutes - default is
zero.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">minutes</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">minutes</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Copy construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<p>
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">nanoseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> minute count converted to nanoseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">microseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> minute count converted to microseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">milliseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> minute count converted to milliseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">seconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> minute count converted to seconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 0
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 60
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> false
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
@@ -3471,96 +3846,125 @@
</code></pre>
</blockquote>
-
<pre><code>
<span class="identifier">hours</span><span class="special">(</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">=</span><span class="number">0</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Construct<span class="underline">s</span> a<span class="underline">n object with a</span> count of hours - default is zero.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="identifier">hours</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">hours</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
</code></pre>
+
<p>
<i>Effects:</i> Copy construction.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<p>
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">nanoseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> hour count converted to nanoseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">microseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> hour count converted to microseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">milliseconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> hour count converted to milliseconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">seconds</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns:</i> hour count converted to seconds
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">operator</span> <span class="identifier">minutes</span><span class="special">()</span> <span class="keyword">const</span>
</code></pre>
+
<p>
<i>Returns: </i> hour count converted to seconds.
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">ticks_per_second</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 0
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="identifier">tick_type</span> <span class="identifier">seconds_per_tick</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> 3600
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
+
<pre><code>
<span class="keyword">static</span> <span class="keyword">bool</span> <span class="identifier">is_subsecond</span><span class="special">();</span>
</code></pre>
+
<p>
<i>Returns:</i> false
</p>
+
<p>
<i>Throws:</i> Nothing.
</p>
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