pthread_timedjoin_np() return EBUSY 什么时候开始?

When does pthread_timedjoin_np() return EBUSY?

我正在尝试处理 pthread_timedjoin_np() 的所有可能的 return 值,但我不太明白,什么时候 return EBUSY?

如果线程 return 在给定时间内 pthread_timedjoin_np() 始终 return 为零,而如果时间已经过去,我会得到 ETIMEDOUT。我需要做什么才能触发 EBUSY

I did not quite understand, when does it return EBUSY?

从来没有。

您正在阅读的手册页适用于 pthread_tryjoin_nppthread_timedjoin_np。当“线程在调用时尚未终止”时,pthread_tryjoin_np 将 return 和 EBUSY

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() can in addition fail with the following errors:

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

ETIMEDOUT The call timed out before thread terminated.