diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-10-16 12:38:54 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-10-18 12:25:59 +0200 |
commit | eecd41e349dd13e3eae2d49eeade5803fdf73773 (patch) | |
tree | 4024be4969935e8c3d6bc73ed3d6bae573f8aa89 /src/libstrongswan/threading/mutex.c | |
parent | 2b6088c7187f30479ef20d305e1972abe3d5a40a (diff) | |
download | strongswan-eecd41e349dd13e3eae2d49eeade5803fdf73773.tar.bz2 strongswan-eecd41e349dd13e3eae2d49eeade5803fdf73773.tar.xz |
Use a helper function to add milliseconds to timeval structs
Diffstat (limited to 'src/libstrongswan/threading/mutex.c')
-rw-r--r-- | src/libstrongswan/threading/mutex.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libstrongswan/threading/mutex.c b/src/libstrongswan/threading/mutex.c index 2ef918a28..df0cd27bf 100644 --- a/src/libstrongswan/threading/mutex.c +++ b/src/libstrongswan/threading/mutex.c @@ -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); } |