Significance of Sleep(0)

前端 未结 8 2092
醉酒成梦
醉酒成梦 2020-12-03 02:19

I used to see Sleep(0) in some part of my code where some infinite/long while loops are available. I was informed that it would make the time-slice

8条回答
  •  离开以前
    2020-12-03 02:55

    I am using using pthreads and for some reason on my mac the compiler is not finding pthread_yield() to be declared. But it seems that sleep(0) is the same thing.

提交回复
热议问题