Opened 15 years ago
Closed 15 years ago
#1328 closed Bugs (fixed)
boost::spirit concurrency gap
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | To Be Determined | Component: | spirit |
Version: | Boost 1.34.1 | Severity: | Problem |
Keywords: | Cc: |
Description
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
...
Change History (2)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Fix applied.