.\" -*- 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_TRYJOIN_NP 3 "21 décembre 2020" Linux "Manuel du programmeur Linux" .SH NOM pthread_tryjoin_np, pthread_timedjoin_np \- Essayer de fusionner avec un thread ayant terminé son exécution .SH SYNOPSIS .nf \fB#define _GNU_SOURCE\fP /* Consultez feature_test_macros(7) */ \fB#include \fP .PP \fBint pthread_tryjoin_np(pthread_t \fP\fIthread\fP\fB, void **\fP\fIretval\fP\fB);\fP .PP \fBint pthread_timedjoin_np(pthread_t \fP\fIthread\fP\fB, void **\fP\fIretval\fP\fB,\fP \fB const struct timespec *\fP\fIabstime\fP\fB);\fP .fi .PP Compiler et éditer les liens avec \fI\-pthreads\fP. .SH DESCRIPTION Ces fonctions opèrent de la même façon que \fBpthread_join\fP(3), à l'exception des différences décrites dans cette page. .PP La fonction \fBpthread_tryjoin_np\fP() essaie de fusionner avec le thread \fIthread\fP si cela est possible sans attendre et renvoie le code de retour du thread dans \fI*retval\fP. Si le \fIthread\fP ne s'est toujours pas terminé, alors au lieu d'être bloquée (comme le fait \fBpthread_join\fP(3)), l'appel renvoie une erreur. .PP The \fBpthread_timedjoin_np\fP() function performs a join\-with\-timeout. If \fIthread\fP has not yet terminated, then the call blocks until a maximum time, specified in \fIabstime\fP, measured against the \fBCLOCK_REALTIME\fP clock. If the timeout expires before \fIthread\fP terminates, the call returns an error. The \fIabstime\fP argument is a structure of the following form, specifying an absolute time measured since the Epoch (see \fBtime\fP(2)): .PP .in +4n .EX struct timespec { time_t tv_sec; /* Secondes */ long tv_nsec; /* Nanosecondes */ }; .EE .in .SH "VALEUR RENVOYÉE" En cas de réussite, ces fonction renvoient 0\ ; en cas d'erreur, elles renvoient un numéro d'erreur. .SH ERREURS Ces fonction peuvent échouer avec les mêmes erreurs que \fBpthread_join\fP(3). \fBpthread_tryjoin_np\fP() peut de plus échouer avec l'erreur suivante\ : .TP \fBEBUSY\fP L'exécution du \fIthread\fP n'était pas terminée au moment de l'appel. .PP \fBpthread_timedjoin_np\fP() can in addition fail with the following errors: .TP \fBETIMEDOUT\fP Le délai a expiré avant que \fIthread\fP ne se soit terminé. .TP \fBEINVAL\fP \fIabstime\fP value is invalid (\fItv_sec\fP is less than 0 or \fItv_nsec\fP is greater than 1e9). .PP \fBpthread_timedjoin_np\fP() ne renvoie jamais d'erreur \fBEINTR\fP. .SH VERSIONS Ces fonctions ont été introduites dans la glibc dans sa version\ 2.3.3. .SH ATTRIBUTS Pour une explication des termes utilisés dans cette section, consulter \fBattributes\fP(7). .ad l .TS allbox; lbw22 lb lb l l l. Interface Attribut Valeur T{ \fBpthread_tryjoin_np\fP(), \fBpthread_timedjoin_np\fP() T} Sécurité des threads MT\-Safe .TE .ad .SH CONFORMITÉ Ces fonctions sont des extensions GNU non standard\ ; d'où le suffixe «\ _np\ » (non portable) dans leur nom. .SH EXEMPLES Le code suivant attend la fin d'exécution d'un thread pour fusionner pendant au plus 5 seconde\ : .PP .in +4n .EX struct timespec ts; int s; \&... if (clock_gettime(CLOCK_REALTIME, &ts) == \-1) { /* Handle error */ } ts.tv_sec += 5; s = pthread_timedjoin_np(thread, NULL, &ts); if (s != 0) { /* Handle error */ } .EE .in .SH BOGUES The \fBpthread_timedjoin_np\fP() function measures time by internally calculating a relative sleep interval that is then measured against the \fBCLOCK_MONOTONIC\fP clock instead of the \fBCLOCK_REALTIME\fP clock. Consequently, the timeout is unaffected by discontinuous changes to the \fBCLOCK_REALTIME\fP clock. .SH "VOIR AUSSI" \fBclock_gettime\fP(2), \fBpthread_exit\fP(3), \fBpthread_join\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/. .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 . 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. 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 .