如果阻塞工作线程,则需要确保仅在合理的时间内阻塞线程。
If a worker thread must be blocked, you need to ensure that the thread is blocked for only a reasonable amount of time.
如果您需要在指定的一段时间内阻塞发出调用的线程,那么请使用pthread_cond _ timewait来阻塞它。
If you need to block the calling thread for a specific time, then use the pthread_cond_timewait to block the thread.
应用推荐