Provided by: manpages-fr-dev_4.13-4_all bug

NOM

       pthread_tryjoin_np,  pthread_timedjoin_np  -  Essayer  de  fusionner  avec  un  thread  ayant terminé son
       exécution

SYNOPSIS

       #define _GNU_SOURCE             /* Consultez feature_test_macros(7) */
       #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);

       Compiler et éditer les liens avec -pthreads.

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.

       La  fonction  pthread_tryjoin_np()  essaie  de  fusionner avec le thread thread si cela est possible sans
       attendre et renvoie le code de retour du thread dans *retval. Si le thread ne s'est toujours pas terminé,
       alors au lieu d'être bloquée (comme le fait pthread_join(3)), l'appel renvoie une erreur.

       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, measured against the CLOCK_REALTIME clock. 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

       Ces  fonction  peuvent  échouer  avec les mêmes erreurs que pthread_join(3). pthread_tryjoin_np() peut de
       plus échouer avec l'erreur suivante :

       EBUSY  L'exécution du thread n'était pas terminée au moment de l'appel.

       pthread_timedjoin_np()  can in addition fail with the following errors:

       ETIMEDOUT
              Le délai a expiré avant que thread ne se soit terminé.

       EINVAL abstime value is invalid (tv_sec is less than 0 or tv_nsec is greater than 1e9).

       pthread_timedjoin_np() ne renvoie jamais d'erreur EINTR.

VERSIONS

       Ces fonctions ont été introduites dans la glibc dans sa version 2.3.3.

ATTRIBUTS

       Pour une explication des termes utilisés dans cette section, consulter attributes(7).
       ┌────────────────────────┬──────────────────────┬─────────┐
       │ InterfaceAttributValeur  │
       ├────────────────────────┼──────────────────────┼─────────┤
       │ pthread_tryjoin_np(),  │ Sécurité des threads │ MT-Safe │
       │ pthread_timedjoin_np() │                      │         │
       └────────────────────────┴──────────────────────┴─────────┘

CONFORMITÉ

       Ces fonctions sont des extensions GNU non standard ; d'où le suffixe « _np »  (non  portable)  dans  leur
       nom.

EXEMPLES

       Le code suivant attend la fin d'exécution d'un thread pour fusionner pendant au plus 5 seconde :

           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 */
           }

BOGUES

       The  pthread_timedjoin_np()   function  measures time by internally calculating a relative sleep interval
       that  is  then  measured  against  the  CLOCK_MONOTONIC  clock  instead  of  the  CLOCK_REALTIME   clock.
       Consequently, the timeout is unaffected by discontinuous changes to the CLOCK_REALTIME clock.

VOIR AUSSI

       clock_gettime(2), pthread_exit(3), pthread_join(3), pthreads(7)

COLOPHON

       Cette page fait partie de la publication 5.10 du projet man-pages 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/.

TRADUCTION

       La  traduction  française   de   cette   page   de   manuel   a   été   créée   par   Christophe   Blaess
       <https://www.blaess.fr/christophe/>,   Stéphan   Rafin   <stephan.rafin@laposte.net>,   Thierry   Vignaud
       <tvignaud@mandriva.com>, François Micaux, Alain Portal  <aportal@univ-montp2.fr>,  Jean-Philippe  Guérard
       <fevrier@tigreraye.org>,   Jean-Luc   Coulon   (f5ibh)   <jean-luc.coulon@wanadoo.fr>,   Julien   Cristau
       <jcristau@debian.org>,     Thomas     Huriaux      <thomas.huriaux@gmail.com>,      Nicolas      François
       <nicolas.francois@centraliens.net>,     Florentin     Duneau    <fduneau@gmail.com>,    Simon    Paillard
       <simon.paillard@resel.enst-bretagne.fr>,    Denis    Barbier    <barbier@debian.org>,    David     Prévot
       <david@tilapin.org> et Frédéric Hantrais <fhantrais@gmail.com>

       Cette  traduction  est  une  documentation libre ; veuillez vous reporter à la GNU General Public License
       version 3 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  à
       debian-l10n-french@lists.debian.org.

Linux                                           21 décembre 2020                           PTHREAD_TRYJOIN_NP(3)