Boost logo

Boost Users :

From: Alexander Carôt (alexander_carot_at_[hidden])
Date: 2021-10-07 09:09:16

Hi all,

I had been using an old boost system and boost thread lib for a couple of years without upgrading it since approx. 2014. With this old lib the following (simplified) code works fine on OSX:

#include "test.h"

test::test() {
    boost::thread::attributes attrs;

    #if defined(BOOST_THREAD_PLATFORM_WIN32)
        res =
        SetThreadPriority(attrs.native_handle(), THREAD_PRIORITY_NORMAL);
        pthread_attr_setschedpolicy(attrs.native_handle(), SCHED_FIFO);
    tracerouteThread = boost::thread(
        attrs, boost::bind(&test::performTraceroute, this));

void test::performTraceroute() {
    cout << "START TRACEROUTE" << endl;

    string exec = "";
    cout << "DO FURTHER STUFF BUT THIS IS JUST A DEMO ..." << endl;
    cout << "THREAD OVER" << endl;

Using the current boost 1_77 still does execute the thread but then it crashes within the destructor. Adding

tracerouteThread.join() or .detach() after launching the thread does not help either.

Can anyone help how to resolve this issue ?

Thanks a lot in advance,


Email : Alexander_at_[hidden]
Tel.: +49 (0)177 5719797

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at