[Boost-bugs] [Boost C++ Libraries] #3531: initial_path is not thread-safe

Subject: [Boost-bugs] [Boost C++ Libraries] #3531: initial_path is not thread-safe
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-10-19 09:10:50

#3531: initial_path is not thread-safe
 Reporter: andysem | Owner: bemandawes
     Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: filesystem
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: initial_path |
 The initial_path template function uses function-local static variable and
 thus is not thread-safe.

 The documentation states the recommendadion to call initial_path from the
 beginning of the main function. However, following it is not sufficient

 1. If the application consists of several modules (dll or so), on many
 architectures each module will contain its own copy of the static variable
 defined in initial_path. Each copy will be initialized as needed, when
 initial_path is called from within the corresponding module.

 2. The threads may already be running when initial_path is called. This
 may be true regardless of whether initial_path is called from main or some
 another place in a dll.

 What makes the problem worse is that there are two such functions,
 actually: initial_path< path >() and initial_path< wpath >(). Each of them
 will have the described problem.

Ticket URL: <https://svn.boost.org/trac/boost/ticket/3531>
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:01 UTC