pthread_tryjoin_np(3) Library Functions Manual pthread_tryjoin_np(3) pthread_tryjoin_np, pthread_timedjoin_np - POSIX (libpthread -lpthread) #define _GNU_SOURCE /* feature_test_macros(7) */ #include int pthread_tryjoin_np(pthread_t thread, void **retval); int pthread_timedjoin_np(pthread_t thread, void **retval, const struct timespec *abstime); pthread_join(3) . pthread_tryjoin_np() thread *retval. thread pthread_join(3) . pthread_timedjoin_np() . thread abstime CLOCK_REALTIME. thread . abstime timespec(3) ( time(2)). 0 . pthread_join(3). pthread_tryjoin_np() : EBUSY thread . pthread_timedjoin_np() : EINVAL abstime (tv_sec 0 tv_nsec 1e9). ETIMEDOUT thread. pthread_timedjoin_np() EINTR . attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |pthread_tryjoin_np(),| | MT-Safe | |pthread_timedjoin_np()| | | +------------+------------------------------------+--------------------+ "_np" ( ) . glibc 2.3.3. pthread_timedjoin_np() CLOCK_MONOTONIC CLOCK_REALTIME. CLOCK_REALTIME. 5 : struct timespec ts; int s; ... if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { /* */ } ts.tv_sec += 5; s = pthread_timedjoin_np(thread, NULL, &ts); if (s != 0) { /* */ } clock_gettime(2), pthread_exit(3), pthread_join(3), timespec(3), pthreads(7) 3 . . : . 6.18 17 2025 pthread_tryjoin_np(3)