lailongwei / llbc

一个简洁、高性能、跨平台、多语言支持的服务端开发框架,面向Service及Component,底层c++实现。
MIT License
335 stars 78 forks source link

【llbc】OS_Thread相关底层方法优化&bug fix #284

Closed lailongwei closed 1 week ago

lailongwei commented 3 weeks ago

附 - Sleep(0)介绍(直接引用msdn文档):

[in] dwMilliseconds

The time interval for which execution is to be suspended, in milliseconds.

A value of zero causes the thread to relinquish the remainder of its time slice to any other thread that is ready to run. If there are no other threads ready to run, the function returns immediately, and the thread continues execution. Windows XP: A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. This behavior changed starting with Windows Server 2003.

A value of INFINITE indicates that the suspension should not time out.

附 - Sleep(0) stack overflow: Significance of Sleep(0)