Ticket #1929: thread-borland-workaround.patch

File thread-borland-workaround.patch, 1.6 KB (added by Giel van Schijndel <me@…>, 14 years ago)

Attempt to workaround bug

  • boost/thread/win32/thread.hpp

     
    214214        }
    215215#else
    216216        template<typename F>
    217         static inline detail::thread_data_ptr make_thread_info(F f)
     217        static inline detail::thread_data_base* make_thread_info(F f)
    218218        {
    219219            return detail::heap_new<thread_data<F> >(f);
    220220        }
     
    228228        thread();
    229229        ~thread();
    230230
     231        void __boost_workaround_to_set_thread_info(detail::thread_data_base* tinfo);
     232
    231233#ifdef BOOST_HAS_RVALUE_REFS
    232234        template <class F>
    233235        thread(F&& f):
     
    237239        }
    238240#else
    239241        template <class F>
    240         explicit thread(F f):
    241             thread_info(make_thread_info(f))
     242        explicit thread(F f)
    242243        {
     244            detail::thread_data_base* const tinfo = make_thread_info(f);
     245            __boost_workaround_to_set_thread_info(tinfo);
    243246            start_thread();
    244247        }
    245248
  • libs/thread/src/win32/thread.cpp

     
    189189    thread::thread()
    190190    {}
    191191
     192    void thread::__boost_workaround_to_set_thread_info(detail::thread_data_base* const tinfo)
     193    {
     194        thread_info = tinfo;
     195    }
     196
    192197    void thread::start_thread()
    193198    {
    194199        uintptr_t const new_thread=_beginthreadex(0,0,&thread_start_function,thread_info.get(),CREATE_SUSPENDED,&thread_info->id);