Non-blocking pthread_join

后端 未结 8 811
一生所求
一生所求 2020-12-01 08:01

I\'m coding the shutdown of a multithreaded server.If everything goes as it should all the threads exit by their own, but there\'s a small chance that a thread gets stuck.In

8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 08:28

    There is no timed pthread_join, but if you are waiting for other thread blocked on conditions, you can use timed pthread_cond_timed_wait instead of pthread_cond_wait

提交回复
热议问题