|
Boost-Commit : |
From: anthony_at_[hidden]
Date: 2008-05-12 05:04:03
Author: anthonyw
Date: 2008-05-12 05:04:02 EDT (Mon, 12 May 2008)
New Revision: 45294
URL: http://svn.boost.org/trac/boost/changeset/45294
Log:
Updated docs to make it explicit that terminate is called if a thread function throws an exception
Text files modified:
trunk/libs/thread/doc/thread_ref.qbk | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
Modified: trunk/libs/thread/doc/thread_ref.qbk
==============================================================================
--- trunk/libs/thread/doc/thread_ref.qbk (original)
+++ trunk/libs/thread/doc/thread_ref.qbk 2008-05-12 05:04:02 EDT (Mon, 12 May 2008)
@@ -43,11 +43,21 @@
// this leads to undefined behaviour
If you wish to construct an instance of __thread__ with a function or callable object that requires arguments to be supplied,
-this can be done using `boost::bind`:
+this can be done by passing additional arguments to the __thread__ constructor:
void find_the_question(int the_answer);
- boost::thread deep_thought_2(boost::bind(find_the_question,42));
+ boost::thread deep_thought_2(find_the_question,42);
+
+The arguments are ['copied] into the internal thread structure: if a reference is required, use `boost::ref`, just as for references
+to callable functions.
+
+There is an unspecified limit on the number of additional arguments that can be passed.
+
+[heading Exceptions in thread functions]
+
+If the function or callable object passed to the __thread__ constructor propagates an exception when invoked that is not of type
+__thread_interrupted__, `std::terminate()` is called.
[heading Joining and detaching]
@@ -212,7 +222,9 @@
[[Preconditions:] [`Callable` must by copyable.]]
-[[Effects:] [`func` is copied into storage managed internally by the thread library, and that copy is invoked on a newly-created thread of execution.]]
+[[Effects:] [`func` is copied into storage managed internally by the thread library, and that copy is invoked on a newly-created
+thread of execution. If this invocation results in an exception being propagated into the internals of the thread library that is
+not of type __thread_interrupted__, then `std::terminate()` will be called.]]
[[Postconditions:] [`*this` refers to the newly created thread of execution.]]
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