_Throw_Cpp_error(_RESOURCE_UNAVAILABLE_TRY_AGAIN); } else { // ownership transferred to the thread (void)_Decay_copied.release(); //转让tuple的所有权给新的线程。 } } ~thread() noexcept { // clean up if (joinable()) { //注意,std::thread析构时,如果线程仍可joinable,则会调用terminat...
_Throw_Cpp_error(_RESOURCE_UNAVAILABLE_TRY_AGAIN); }else{//ownership transferred to the thread(void)_Decay_copied.release();//转让tuple的所有权给新的线程。} }~thread() noexcept {//clean upif(joinable()) {//注意,std::thread析构时,如果线程仍可joinable,则会调用terminate终止程序!_STD term...
若运行策略等于 std::launch::async 且实现无法开始新线程(该情况下,若运行策略为 async|deferred 或设置了额外位,则它将回退到 deferred 或实现定义的策略),则抛出以 std::errc::resource_unavailable_try_again 为错误条件的 std::system_error ,或者若无法分配内部数据结构所用的内存,则为 std::bad_alloc。
_Throw_Cpp_error(_RESOURCE_UNAVAILABLE_TRY_AGAIN);} else { // ownership transferred to the thread (void)_Decay_copied.release(); //转让tuple的所有权给新的线程。} } ~thread() noexcept { // clean up if (joinable()) { //注意,std::thread析构时,如果线程仍可joinable,则会调⽤...
resource_deadlock_would_occur EDEADLK resource_unavailable_try_again EAGAIN result_out_of_range ERANGE state_not_recoverable ENOTRECOVERABLE stream_timeout ETIME text_file_busy ETXTBSY timed_out ETIMEDOUT too_many_files_open_in_system ENFILE too_many_files_open EMFILE too_many_links EMLINK too_...
resource_deadlock_would_occurEDEADLK resource_unavailable_try_againEAGAIN result_out_of_rangeERANGE state_not_recoverableENOTRECOVERABLE stream_timeout(弃用)ETIME text_file_busyETXTBSY timed_outETIMEDOUT too_many_files_open_in_systemENFILE too_many_files_openEMFILE ...
resource_deadlock_would_occurEDEADLK resource_unavailable_try_againEAGAIN result_out_of_rangeERANGE state_not_recoverableENOTRECOVERABLE stream_timeoutETIME text_file_busyETXTBSY timed_outETIMEDOUT too_many_files_open_in_systemENFILE too_many_files_openEMFILE ...
1) 可能抛出 std::system_error,它的 std::error_condition 在线程没有创建条件变量的权限时等于 std::errc::operation_not_permitted,在某项非内存资源限制阻止这此初始化时等于 std::errc::resource_unavailable_try_again,或者等于其他由实现定义的值。
1)May throwstd::system_errorwithstd::error_conditionequal tostd::errc::operation_not_permittedif the thread has no privilege to create a condition variable,std::errc::resource_unavailable_try_againif a non-memory resource limitation prevents this initialization, or another implementation-defined valu...
Throwsstd::system_errorwith error conditionstd::errc::resource_unavailable_try_againif the launch policy equalsstd::launch::asyncand the implementation is unable to start a new thread (if the policy isasync|deferredor has additional bits set, it will fall back to deferred or the implementation...