summaryrefslogtreecommitdiff
path: root/src/libstrongswan/threading/rwlock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/threading/rwlock.c')
-rw-r--r--src/libstrongswan/threading/rwlock.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libstrongswan/threading/rwlock.c b/src/libstrongswan/threading/rwlock.c
index 7097a8e8c..176445705 100644
--- a/src/libstrongswan/threading/rwlock.c
+++ b/src/libstrongswan/threading/rwlock.c
@@ -18,7 +18,7 @@
#include <pthread.h>
#include <library.h>
-#include <debug.h>
+#include <utils/debug.h>
#include "rwlock.h"
#include "rwlock_condvar.h"
@@ -433,13 +433,8 @@ METHOD(rwlock_condvar_t, timed_wait, bool,
ms = timeout % 1000;
tv.tv_sec += s;
- tv.tv_usec += ms * 1000;
+ timeval_add_ms(&tv, ms);
- if (tv.tv_usec > 1000000 /* 1s */)
- {
- tv.tv_usec -= 1000000;
- tv.tv_sec++;
- }
return timed_wait_abs(this, lock, tv);
}