Esempio n. 1
0
        void add_thread(thread* thrd)
        {
            if(thrd)
            {
                BOOST_THREAD_ASSERT_PRECONDITION( ! is_thread_in(thrd) ,
                    thread_resource_error(static_cast<int>(system::errc::resource_deadlock_would_occur), "boost::thread_group: trying to add a duplicated thread")
                );

                boost::lock_guard<shared_mutex> guard(m);
                threads.push_back(thrd);
            }
        }
Esempio n. 2
0
        void add_thread(hpx::thread* thrd)
        {
            if(thrd)
            {
                if(is_thread_in(thrd))
                {
                    HPX_THROW_EXCEPTION(
                        hpx::thread_resource_error, "thread_group::add_thread",
                        "resource_deadlock_would_occur: trying to add a "
                            "duplicated thread");
                    return;
                };

                boost::lock_guard<mutex_type> guard(mtx_);
                threads.push_back(thrd);
            }
        }