mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
timerBUG
linux系统在特定的时间点,_gettime()会溢出,timer将不会触发timeout事件
This commit is contained in:
@@ -220,8 +220,8 @@ _gettime(void) {
|
||||
void
|
||||
skynet_updatetime(void) {
|
||||
uint32_t ct = _gettime();
|
||||
if (ct > TI->current) {
|
||||
int diff = ct-TI->current;
|
||||
if (ct != TI->current) {
|
||||
int diff = ct>=TI->current?ct-TI->current:(0xffffff+1)*100-TI->current+ct;
|
||||
TI->current = ct;
|
||||
int i;
|
||||
for (i=0;i<diff;i++) {
|
||||
|
||||
Reference in New Issue
Block a user