Breaking changes in Boost.Thread 3.0.0

后端 未结 2 1512
無奈伤痛
無奈伤痛 2021-01-18 01:16

In the release notes of version 1.50.0 of the Boost libraries I noted two breaking changes (see here):

#6266 Breaking change: thread destructor should ca

2条回答
  •  囚心锁ツ
    2021-01-18 02:06

    When it says "Breaking change", it means, "Your program is broken if you depend on behaviour which was previously X, but is now Y".

    For the given two changes, it means that if you rely on the destructor or move assignment calling join() (or detach()), which I believe was the previous behaviour, your program must now explicitly join() or detach() or meet your friend std::terminate(). It's not a compile-time error, but nor is it unpredictable run-time behaviour- you'll get a nice clean crash leading right back to boost::thread's destructor, which is the cause of the problem.

提交回复
热议问题