|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80198 - trunk/libs/thread/doc
From: vicente.botet_at_[hidden]
Date: 2012-08-25 08:28:43
Author: viboes
Date: 2012-08-25 08:28:42 EDT (Sat, 25 Aug 2012)
New Revision: 80198
URL: http://svn.boost.org/trac/boost/changeset/80198
Log:
Thread: update tss doc to take care of #2361 and #3837
Text files modified:
trunk/libs/thread/doc/tss.qbk | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
Modified: trunk/libs/thread/doc/tss.qbk
==============================================================================
--- trunk/libs/thread/doc/tss.qbk (original)
+++ trunk/libs/thread/doc/tss.qbk 2012-08-25 08:28:42 EDT (Sat, 25 Aug 2012)
@@ -47,6 +47,10 @@
`boost::thread` unless `boost::on_thread_exit()` is called manually
from that thread.
+[heading Rational about the nature of the key]
+
+Boost.Thread uses the address of the `thread_specific_ptr` instance as key of the thread specific pointers. This avoids to create/destroy a key which will need a lock to protect from race conditions. This has a little performance liability, as the access must be done using an associative container.
+
[section:thread_specific_ptr Class `thread_specific_ptr`]
#include <boost/thread/tss.hpp>
@@ -102,10 +106,14 @@
[variablelist
+[[Requires:] [All the thread specific instances associated to this thread_specific_ptr (except maybe the one associated to this thread) must be null.]]
+
[[Effects:] [Calls `this->reset()` to clean up the associated value for the current thread, and destroys `*this`.]]
[[Throws:] [Nothing.]]
+[[Remarks:] [The requirement is due to the fact that in order to delete all these instances, the implementation should be forced to maintain a list of all the threads having an associated specific ptr, which is against the goal of thread specific data.]]
+
]
[note Care needs to be taken to ensure that any threads still running after an instance of `boost::thread_specific_ptr` has been
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