I am trying to handle all the possible return values of pthread_timedjoin_np(), but I did not quite understand, when does it return EBUSY?
If the thread returns within the given time pthread_timedjoin_np() always returns zero, while if time has passed I get ETIMEDOUT. What do I have to do to trigger EBUSY?
Never.
The man page that you are reading is for both
pthread_tryjoin_npandpthread_timedjoin_np.pthread_tryjoin_npwill return withEBUSYwhen "thread had not yet terminated at the time of the call".