src/runtime/threads/executors/current_executor.cpp
void current_executor::add(
        closure_type&& f, util::thread_description const& desc,
        threads::thread_state_enum initial_state,
        bool run_now, threads::thread_stacksize stacksize, error_code& ec)
    {
        // create a new thread
        thread_init_data data(util::bind(
            util::one_shot(&current_executor::thread_function_nullary),
            std::move(f)), desc);
        data.stacksize = threads::get_stack_size(stacksize);

        threads::thread_id_type id = threads::invalid_thread_id;
        threads::detail::create_thread(scheduler_base_, data, id, //-V601
            initial_state, run_now, ec);
        if (ec) return;

        if (&ec != &throws)
            ec = make_success_code();
    }
// Schedule the specified function for execution in this executor.
// Depending on the subclass implementation, this may block in some
// situations.
Schedule the specified function for execution in this executor.
Depending on the subclass implementation, this may block in some
situations.
Schedule the specified function for execution in this executor . Depending on the subclass implementation this may block in some situations .
void current_executor::add(
        closure_type&& f, util::thread_description const& desc,
        threads::thread_state_enum initial_state,
        bool run_now, threads::thread_stacksize stacksize, error_code& ec)
    {
        thread_init_data data(util::bind(
            util::one_shot(&current_executor::thread_function_nullary),
            std::move(f)), desc);
        data.stacksize = threads::get_stack_size(stacksize);
        threads::thread_id_type id = threads::invalid_thread_id;
        threads::detail::create_thread(scheduler_base_, data, id, 
            initial_state, run_now, ec);
        if (ec) return;
        if (&ec != &throws)
            ec = make_success_code();
    }
void current_executor :: add ( closure_type && f , util :: thread_description const & desc , threads :: thread_state_enum initial_state , bool run_now , threads :: thread_stacksize stacksize , error_code & ec ) { thread_init_data data ( util :: bind ( util :: one_shot ( & current_executor :: thread_function_nullary ) , std :: move ( f ) ) , desc ) ; data . stacksize = threads :: get_stack_size ( stacksize ) ; threads :: thread_id_type id = threads :: invalid_thread_id ; threads :: detail :: create_thread ( scheduler_base_ , data , id , initial_state , run_now , ec ) ; if ( ec ) return ; if ( & ec != & throws ) ec = make_success_code ( ) ; }
Schedule the specified function for execution in this executor.
Schedule the specified function for execution in this executor .
// create a new thread //-V601