Subject: [Boost-bugs] [Boost C++ Libraries] #1328: boost::spirit concurrency gap
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-10-19 08:43:19
#1328: boost::spirit concurrency gap
-------------------------------+--------------------------------------------
Reporter: vlad_news_at_[hidden] | Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost 1.34.1 | Severity: Problem
Keywords: |
-------------------------------+--------------------------------------------
The following snipped code from the "boost::spirit" library contains the
problem with concurrent access to a static object. Creation of a object of
"thread_specific_ptr" type should be protected while concurrent access is
performed.
//boost\spirit\core\non_terminal\impl\grammar.ipp
...
# ifdef BOOST_SPIRIT_THREADSAFE
//should be protected with a "call once" idiom
static boost::thread_specific_ptr<ptr_t> tld_helper;
if (!tld_helper.get())
tld_helper.reset(new ptr_t);
ptr_t &helper = *tld_helper;
# else
static ptr_t helper;
# endif
...
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1328>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:56 UTC