Re: [Boost-bugs] [Boost C++ Libraries] #3526: Data races in boost::thread detected by drd/helgrind

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3526: Data races in boost::thread detected by drd/helgrind
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-06-05 11:14:28


#3526: Data races in boost::thread detected by drd/helgrind
-------------------------------------+--------------------------------------
 Reporter: m.strashun@… | Owner: anthonyw
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost Development Trunk | Severity: Problem
 Keywords: valgrind,drd,threading |
-------------------------------------+--------------------------------------

Comment(by bvanassche@…):

 Replying to [comment:6 bvanassche@…]:
> This is a real bug. With the current implementation it is possible that
 call_once() invokes its
> second argument (Function f) twice. flag.epoch should be tested again
 after
> detail::once_epoch_mutex has been locked, just like as when applying the
 double-checked
> optimization to the singleton pattern.

 Please ignore the above comment -- I overlooked the
 pthread_mutex_scoped_lock statement near the beginning of call_once()
 which guarantees thread-safe updating of flag.epoch and also that f() is
 invoked by only one thread.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3526#comment:7>
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:50:03 UTC