If you are running your application on Linux, you may be interested to know that:
int pthread_tryjoin_np(pthread_t thread, void **retval);
int pthread_timedjoin_np(pthread_t thread, void **retval,
const struct timespec *abstime);
Be careful, as the suffix suggests it, “np” means “non-portable”. They are not POSIX standard, gnu extensions, useful though.
link to man page
Related Contents:
- Undefined reference to pthread_create in Linux
- When the main thread exits, do other threads also exit?
- Kill Thread in Pthread Library
- Is it possible to determine the thread holding a mutex?
- How do you query a pthread to see if it is still running?
- Can I get Unix’s pthread.h to compile in Windows?
- Using C/Pthreads: do shared variables need to be volatile?
- How can I pass the index of a for loop as the argument for pthread_create
- Linux/POSIX equivalent for Win32’s CreateEvent, SetEvent, WaitForSingleObject
- Pthread Run a thread right after it’s creation
- Still Reachable Leak detected by Valgrind
- Why do pthreads’ condition variable functions require a mutex?
- Why does pthread_cond_wait have spurious wakeups?
- Is errno thread-safe?
- Is malloc thread-safe?
- How do I start threads in plain C?
- Multiple arguments to function called by pthread_create()?
- sem_init on OS X
- Does guarding a variable with a pthread mutex guarantee it’s also not cached?
- Wake up thread blocked on accept() call
- Undefined reference to ‘pthread_create’ — linker command option order (libraries before/after object files?) [duplicate]
- Does pthread_cond_wait(&cond_t, &mutex); unlock and then lock the mutex?
- How to return a value from pthread threads in C?
- Do threads have a distinct heap?
- How to set the name of a thread in Linux pthreads?
- POSIX threads and signals
- Signal handling with multiple threads in Linux
- How to set the stacksize with C++11 std::thread
- Detached vs. Joinable POSIX threads
- How do I get a thread ID from an arbitrary pthread_t?
- Multi-threading benchmarking issues
- Memory order consume usage in C11
- Share condition variable & mutex between processes: does mutex have to locked before?
- How to signal select() to return immediately?
- pthreads: thread starvation caused by quick re-locking
- Pass integer value through pthread_create
- Does any C library implement C11 threads for GNU/Linux?
- When to use pthread_exit() and when to use pthread_join() in Linux?
- When to use pthread condition variables?
- Check to see if a pthread mutex is locked or unlocked (After a thread has locked itself)
- Is accept() thread-safe?
- Does “volatile” guarantee anything at all in portable C code for multi-core systems?
- Implementing a FIFO mutex in pthreads
- pthread execution on linux
- Is it possible to access/update the child thread’s resource from parent thread?
- How to get the number of CPUs in Linux using C?
- How to make main thread wait for all child threads finish?
- Signal handling in pthreads
- CPU cache inhibition
- How to get thread id of a pthread in linux c program?