Re: [Boost-bugs] [Boost C++ Libraries] #12987: boost::filesystem::exists crashes

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12987: boost::filesystem::exists crashes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-05-03 14:15:37

#12987: boost::filesystem::exists crashes
  Reporter: Leinad | Owner: bemandawes
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: filesystem
   Version: Boost 1.64.0 | Severity: Problem
Resolution: | Keywords:

Comment (by anonymous):

 Is it thread safe?
 #include <boost\filesystem.hpp>

 const int thread_num = 10;
 boost::barrier barrier(thread_num + 1);

 bool c = []
         std::vector<std::thread> threads;
         for (int i = 0; i < thread_num; ++i)
         for (auto& thread: threads)
         return true;

 int main(int argc, char* argv[])
         return 0;

 {{{c}}} could be (probably is) initialised before
 {{{compare_function_initializer}}} in the unnamed namespace in
 operations.cpp. All those threads will call {{{compare()}}} and there
 might be race condition at reading/setting {{{compare_function}}}.

 I guess on many platforms reading/assigning a pointer is atomic in
 practice, and {{{GetProcAddress}}} and {{{GetModuleHandle}}} are thread-
 safe, too, so this is not an issue here.

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-05-03 14:20:12 UTC