.\" -*- coding: UTF-8 -*- .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk .\" .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH PTHREAD_JOIN 3 "9 juin 2020" Linux "Manuel du programmeur Linux" .SH NOM pthread_join \- Joindre un thread terminé .SH SYNOPSIS .nf \fB#include \fP .PP \fBint pthread_join(pthread_t \fP\fIthread\fP\fB, void **\fP\fIretval\fP\fB);\fP .fi .PP Compiler et éditer les liens avec \fI\-pthreads\fP. .SH DESCRIPTION La fonction \fBpthread_join\fP() attend que le thread spécifié par \fIthread\fP se termine. Si ce thread s'est déjà terminé, \fBpthread_join\fP() revient tout de suite. Le thread spécifié par \fIthread\fP doit être joignable. .PP Si \fIretval\fP n'est pas NULL, \fBpthread_join\fP() copie la valeur de sortie du thread cible (c'est\-à\-dire la valeur que le thread cible a fournie à \fBpthread_exit\fP(3)) dans l'emplacement pointé par \fIretval\fP. Si le thread cible est annulé, \fBPTHREAD_CANCELED\fP est placé dans l'emplacement pointé par \fIretval\fP .PP Si plusieurs threads essaient simultanément de joindre le même thread, le résultat est indéfini. Si le thread appelant \fBpthread_join\fP() est annulé, le thread cible reste joignable (c'est\-à\-dire qu'il ne sera pas détaché). .SH "VALEUR RENVOYÉE" En cas de réussite, \fBpthread_join\fP() renvoie 0\ ; en cas d'erreur, elle renvoie un numéro d'erreur. .SH ERREURS .TP \fBEDEADLK\fP .\" The following verified by testing on glibc 2.8/NPTL: .\" The following verified by testing on glibc 2.8/NPTL: Un verrou perpétuel (\fIdeadlock\fP) a été détecté, par exemple deux threads essaient de se joindre mutuellement\ ; ou bien \fIthread\fP est aussi le thread appelant. .TP \fBEINVAL\fP \fIthread\fP n'est pas un thread joignable. .TP \fBEINVAL\fP .\" POSIX.1-2001 does not specify this error case. Un autre thread attend déjà de joindre ce thread. .TP \fBESRCH\fP Aucun fil d’exécution avec pour identifiant \fIthread\fP n'a pu être trouvé. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .TS allbox; lb lb lb l l l. Interface Attribut Valeur T{ \fBpthread_join\fP() T} Sécurité des threads MT\-Safe .TE .sp 1 .SH CONFORMITÉ POSIX.1\-2001, POSIX.1\-2008. .SH NOTES Après le succès d'un appel à \fBpthread_join\fP(), l'appelant est certain que le thread cible est achevé. L'appelant peut alors choisir de faire tout le nettoyage requis après l'achèvement du thread (par exemple, libérer la mémoire ou les autres ressources qui ont été allouées au thread cible). .PP Joindre un thread qui avait préalablement été joint résulte en un comportement indéfini. .PP Un échec à joindre un thread qui est joignable (c'est\-à\-dire non détaché) produit un «\ thread zombie\ ». Il faut l'éviter, car chaque thread zombie consomme des ressources du système, et si trop de threads zombies s'accumulent, il ne sera plus possible de créer de nouveaux threads (ou de nouveaux processus). .PP Il n'existe pas d'analogue pthreads à \fIwaitpid(\-1,\ &status,\ 0)\fP pour joindre tout thread non terminé. Si vous pensez avoir besoin de cette fonctionnalité, vous devez probablement repenser la conception de votre application. .PP Tous les threads dans un processus sont au même niveau\ : tout thread peut joindre tout autre thread du processus. .SH EXEMPLES Consultez \fBpthread_create\fP(3). .SH "VOIR AUSSI" \fBpthread_cancel\fP(3), \fBpthread_create\fP(3), \fBpthread_detach\fP(3), \fBpthread_exit\fP(3), \fBpthread_tryjoin_np\fP(3), \fBpthreads\fP(7) .SH COLOPHON Cette page fait partie de la publication\ 5.10 du projet \fIman\-pages\fP Linux. Une description du projet et des instructions pour signaler des anomalies et la dernière version de cette page peuvent être trouvées à l'adresse \%https://www.kernel.org/doc/man\-pages/. .PP .SH TRADUCTION La traduction française de cette page de manuel a été créée par Christophe Blaess , Stéphan Rafin , Thierry Vignaud , François Micaux, Alain Portal , Jean-Philippe Guérard , Jean-Luc Coulon (f5ibh) , Julien Cristau , Thomas Huriaux , Nicolas François , Florentin Duneau , Simon Paillard , Denis Barbier , David Prévot et Frédéric Hantrais . .PP Cette traduction est une documentation libre ; veuillez vous reporter à la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 .UE concernant les conditions de copie et de distribution. Il n'y a aucune RESPONSABILITÉ LÉGALE. .PP Si vous découvrez un bogue dans la traduction de cette page de manuel, veuillez envoyer un message à .MT debian-l10n-french@lists.debian.org .ME .