[Boost-bugs] [Boost C++ Libraries] #12391: Visual Studio 2010 hangs up when linking boost log object

Subject: [Boost-bugs] [Boost C++ Libraries] #12391: Visual Studio 2010 hangs up when linking boost log object
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-08-12 14:59:54


#12391: Visual Studio 2010 hangs up when linking boost log object
--------------------------------+---------------------
 Reporter: xinyan.zhang@… | Owner: andysem
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: log
  Version: Boost 1.61.0 | Severity: Problem
 Keywords: Visual Studio 2010 |
--------------------------------+---------------------
 I am using Visual Studio 2010 with SP1. I met a very strange problem:
 Visual Studio 2010 hangs up when linking boost log object. There is a
 work-around -- stop the building and restart it. Then it will success.

 I found if I set the second parameter "start_thread" to false in my sink
 ctor, and start thread explicitly, this problem disappears. But the second
 problem appears -- the application hangs up at run time. I have to remove
 the line "fileSink->run();". Then it does not hang up in either building
 and run time.

 My question is if I does not start thread for asynchronous_sink, is there
 any problem or any impact to the performance? Any way, I can still see the
 log record. Thank you.

 {{{
         typedef boost::log::sinks::asynchronous_sink<
 boost::log::sinks::text_file_backend > text_sink;
         boost::shared_ptr< text_sink > fileSink;
         boost::shared_ptr< sinks::text_file_backend > backend =
         boost::make_shared< sinks::text_file_backend >(
                         boost::log::keywords::file_name = filePath,
                         boost::log::keywords::time_based_rotation =
 sinks::file::rotation_at_time_point(0, 0, 0) //file rotation every day at
 midnight
                         );

         fileSink.reset(new text_sink(backend, false)); // hangs up during
 linking object, if set to true

         //fileSink->run(); // hangs up during rum time
 }}}

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