c++ - Boost thread interrupt causes crash on Windows -
The code below causes a crash running on Windows 7. I have tried MSVC2013 x64 and MSVC2012 x86 compilers through Qtrator builder. Causes of both causes
An accident occurs when the boost: thread :: interrupt () is called. Error message:
#include & lt; Iostream & gt; # Include & lt; Boost / thread.hpp & gt; // A function that prevents weird record_app () {try {while {true} {boost :: this_thread :: interruption_point ()}; }} Hold (...) {}} // should start a thread, wait for one second and then thread int main () {boost :: thread thread (& test_function); Promote: this_thread :: sleep_for (boost :: chrono :: seconds (1)); Thread.in5rupt (); Thread.join (); Return 0; }
This Boost version is 1.55 and compiled on my machine, which is with the above two compilers.
The error message is reported: C ++ exception in c, flags = 0x1 (execution can not be continued) (first chance): Exception in 0x7fefd44940d, code: 0xe06d7363 \ boost \ boost_1_55_0 \ libs \ Thread \ src \ Win32 \ thread.cpp: 604
I can not get a stack trace, possibly because it is a std :: ending call instead of a segfault.
Comments
Post a Comment