nanosleep patch.

This commit is contained in:
Diego Nehab 2004-08-04 20:51:57 +00:00
parent e27fa00e1c
commit e4d4c828d9
3 changed files with 7 additions and 2 deletions

3
FIX
View File

@ -1 +1,2 @@
filter.chain is coroutine-free
gettime returns time since Unix Epoch 1/1/1970 (UTC)
sleep is robust to interrupts

1
TODO
View File

@ -1,3 +1,4 @@
fix manual for gettime and sleep
use wim's filter.chain
use mike's "don't set to blocking before closing unless needed" patch?
take a look at DB's smtp patch (add "extra argument" table)

View File

@ -199,7 +199,10 @@ int tm_lua_sleep(lua_State *L)
n -= t.tv_sec;
t.tv_nsec = (int) (n * 1000000000);
if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;
nanosleep(&t, &r);
while (nanosleep(&t, &r) != 0) {
t.tv_sec = r.tv_sec;
t.tv_nsec = r.tv_nsec;
}
#endif
return 0;
}