Provided by:
manpages-fr-dev_3.17.1-1_all 
NOM
pthread_tryjoin_np, pthread_timedjoin_np - try to join with a
terminated thread
SYNOPSIS
#define _GNU_SOURCE
#include <pthread.h>
int pthread_tryjoin_np(pthread_t thread, void **retval);
int pthread_timedjoin_np(pthread_t thread, void **retval,
const struct timespec *abstime);
Compilez et effectuez l’édition des liens avec l’option -pthread.
DESCRIPTION
Ces fonctions opèrent de la même façon que pthread_join(3), à
l’exception des différences décrites dans cette page.
The pthread_tryjoin_np() function performs a non-blocking join with
the thread thread, returning the exit status of the thread in *retval.
If thread has not yet terminated, then instead of blocking, as is done
by pthread_join(3), the call returns an error.
The pthread_timedjoin_np() function performs a join-with-timeout. If
thread has not yet terminated, then the call blocks until a maximum
time, specified in abstime. If the timeout expires before thread
terminates, the call returns an error. The abstime argument is a
structure of the following form, specifying an absolute time measured
since the Epoch (see time(2)):
struct timespec {
time_t tv_sec; /* Secondes */
long tv_nsec; /* Nanosecondes */
};
VALEUR RENVOYÉE
En cas de réussite, ces fonction renvoient 0 ; en cas d’erreur, elles
renvoient un numéro d’erreur.
ERREURS
These functions can fail with the same errors as pthread_join(3).
pthread_tryjoin_np() can in addition fail with the following error:
EBUSY thread had not yet terminated at the time of the call.
pthread_timedjoin_np() peut également échouer avec les erreurs
suivantes:
ETIMEDOUT
Le délai a expiré avant que le fil d’exécution se soit terminé.
pthread_timedjoin_np() ne renvoie jamais d’erreur EINTR.
VERSIONS
Ces fonctions ont été introduites dans la glibc dans sa version 2.3.3.
CONFORMITÉ
Ces fonctions sont des extensions non standard GNU ; c’est la raison du
suffixe « _np » (non portable) dans leur nom.
EXEMPLE
The following code waits to join for up to 5 seconds:
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 */
}
VOIR AUSSI
clock_gettime(3), pthread_join(3), pthread_exit(3), pthreads(7)
COLOPHON
Cette page fait partie de la publication 3.17 du projet man-pages
Linux. Une description du projet et des instructions pour signaler des
anomalies peuvent être trouvées à l’adresse
http://www.kernel.org/doc/man-pages/.
TRADUCTION
Cette page de manuel a été traduite et est maintenue par Nicolas
François <nicolas.francois@centraliens.net> et l’équipe francophone de
traduction de Debian.
Veuillez signaler toute erreur de traduction en écrivant à
<debian-l10n-french@lists.debian.org> ou par un rapport de bogue sur le
paquet manpages-fr.
Vous pouvez toujours avoir accès à la version anglaise de ce document
en utilisant la commande « man -L C <section> <page_de_man> ».