Exemplo n.º 1
0
    void io_service_pool::thread_run(std::size_t index, compat::barrier* startup)
    {
        // wait for all threads to start up before before starting HPX work
        if (startup != nullptr)
            startup->wait();

        if (on_start_thread_)
            on_start_thread_(index, pool_name_postfix_);

        // use this thread for the given io service
        while (true)
        {
            io_services_[index]->run();   // run io service

            if (waiting_)
            {
                wait_barrier_.wait();
                continue_barrier_.wait();
            }
            else
            {
                break;
            }
        }

        if (on_stop_thread_)
            on_stop_thread_(index, pool_name_postfix_);
    }
Exemplo n.º 2
0
    void io_service_pool::thread_run(std::size_t index)
    {
        if (on_start_thread_)
            on_start_thread_(index, pool_name_postfix_);

        // use this thread for the given io service
        io_services_[index]->run();   // run io service

        if (on_stop_thread_)
            on_stop_thread_();
    }
Exemplo n.º 3
0
 void on_start_thread(std::size_t num_thread)
 {
     if (on_start_thread_)
         on_start_thread_(num_thread, "");
 }