Use a helper function to add milliseconds to timeval structs

This commit is contained in:
Tobias Brunner
2012-10-18 12:25:59 +02:00
parent 2b6088c718
commit eecd41e349
6 changed files with 22 additions and 37 deletions
+1 -7
View File
@@ -282,13 +282,7 @@ METHOD(condvar_t, timed_wait, bool,
ms = timeout % 1000;
tv.tv_sec += s;
tv.tv_usec += ms * 1000;
if (tv.tv_usec > 1000000 /* 1s */)
{
tv.tv_usec -= 1000000;
tv.tv_sec++;
}
timeval_add_ms(&tv, ms);
return timed_wait_abs(this, mutex, tv);
}