thread_create
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Definido no cabeçalho <threads.h>
|
||
int thrd_create( thrd_t *thr, thrd_start_t func, void *arg ); |
(desde C11) | |
Cria um novo segmento de executar o
func função. A função é chamada como func(arg).Original:
Creates a new thread executing the function
func. The function is invoked as func(arg).The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Se for bem sucedido, o objeto apontado por
thr está definido para o identificador do segmento novo.Original:
If successful, the object pointed to by
thr is set to the identifier of the new thread.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
A realização desta função é sincronizado com o início da rosca.
Original:
The completion of this function synchronizes with the beginning of the thread.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parâmetros
| thr | - | ponteiro ao local de memória para colocar o identificador do novo segmento
Original: pointer to memory location to put the identifier of the new thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| func | - | função a ser executada
Original: function to execute The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| arg | - | argumento para passar para a função
Original: argument to pass to the function 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
thrd_success se a criação do novo segmento foi bem sucedida. Caso contrário, retorna thrd_nomem se havia quantidade insuficiente de memória ou thrd_error se outro erro.Original:
thrd_success if the creation of the new thread was successful. Otherwise returns thrd_nomem if there was insufficient amount of memory or thrd_error if another error occurred.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Notas
O fio identifica pode ser reutilizado para novos tópicos uma vez que o segmento foi concluído e entrou ou individual.
Original:
The thread identifies may be reused for new threads once the thread has finished and joined or detached.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Veja também
(C11) |
destaca uma discussão Original: detaches a thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
(C11) |
blocos até que um segmento termina Original: blocks until a thread terminates The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |