示例#1
0
        void join_all()
        {
            BOOST_THREAD_ASSERT_PRECONDITION( ! is_this_thread_in() ,
                thread_resource_error(static_cast<int>(system::errc::resource_deadlock_would_occur), "boost::thread_group: trying joining itself")
            );
            boost::shared_lock<shared_mutex> guard(m);

            for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();
                it!=end;
                ++it)
            {
              if ((*it)->joinable())
                (*it)->join();
            }
        }
示例#2
0
        void join_all()
        {
            if (is_this_thread_in())
            {
                HPX_THROW_EXCEPTION(
                    hpx::thread_resource_error, "thread_group::join_all",
                    "resource_deadlock_would_occur: trying joining itself");
                return;
            }

            boost::shared_lock<mutex_type> guard(mtx_);
            for (hpx::thread* t: threads)
            {
                if (t->joinable())
                    t->join();
            }
        }