summaryrefslogtreecommitdiff
path: root/src/libstrongswan/threading/mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/threading/mutex.c')
-rw-r--r--src/libstrongswan/threading/mutex.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libstrongswan/threading/mutex.c b/src/libstrongswan/threading/mutex.c
index 2ef918a28..f86e781c5 100644
--- a/src/libstrongswan/threading/mutex.c
+++ b/src/libstrongswan/threading/mutex.c
@@ -21,7 +21,7 @@
#include <errno.h>
#include <library.h>
-#include <debug.h>
+#include <utils/debug.h>
#include "condvar.h"
#include "mutex.h"
@@ -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);
}