◐ Shell
clean mode source ↗

std::thread::detach - cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

void detach();

(desde C++11)

Separa o segmento de execução do objeto segmento, permitindo a execução de continuar de forma independente. Quaisquer recursos alocados serão liberados uma vez que as saídas de rosca.

Original:

Separates the thread of execution from the thread object, allowing execution to continue independently. Any allocated resources will be freed once the thread exits.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Depois de chamar detach, as seguintes condições irá realizar:

Original:

After calling detach, the following conditions will hold:

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

  • *this já não possui qualquer segmento

    Original:

    *this no longer owns any thread

    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.

  • joinable() == false
  • get_id() == std::thread::id()

Parâmetros

(Nenhum)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

(Nenhum)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exceções

std::system_error se joinable() == false ou ocorre um erro.

Original:

std::system_error if joinable() == false or an error occurs.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exemplo

Veja também

espera que um objeto thread termine sua execução antes de sair da função
(função pública membro) [edit]

verifica se o segmento está acopláveis, ou seja, potencialmente executado no contexto paralelo

Original:

checks whether the thread is joinable, i.e. potentially running in parallel context

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(função pública membro) [edit]