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;

    /// START TRACEROUTE THREAD
    #if defined(BOOST_THREAD_PLATFORM_WIN32)
        res =
        SetThreadPriority(attrs.native_handle(), THREAD_PRIORITY_NORMAL);
    #elif defined(BOOST_THREAD_PLATFORM_PTHREAD)
        pthread_attr_setschedpolicy(attrs.native_handle(), SCHED_FIFO);
    #endif
    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,
best

Alex

--
http://www.carot.de
Email : alexan...@carot.de
Tel.: +49 (0)177 5719797

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users

Reply via email to