这两个函数是非线程安全的,可能会造成程序卡死。

对于c++程序,建议使用std::this_thread::sleep_for()和std::this_thread::yield()代替。

纯c程序可考虑使用select代替。

 

资料参考:

https://blog.csdn.net/lisayh/article/details/76684750

https://www.cnblogs.com/colin-chan/archive/2013/02/03/2890708.html

https://blog.csdn.net/weixin_34362991/article/details/92696518

 

相关文章: