From 3d5818ec38c464b24f382d88c70b10df6c04b160 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 31 Aug 2009 15:13:48 +0200 Subject: use monotonic time source in convar->timed_wait, and in the scheduler using it --- src/libstrongswan/utils/mutex.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/libstrongswan/utils/mutex.h') diff --git a/src/libstrongswan/utils/mutex.h b/src/libstrongswan/utils/mutex.h index 273f56b47..39763f901 100644 --- a/src/libstrongswan/utils/mutex.h +++ b/src/libstrongswan/utils/mutex.h @@ -98,11 +98,11 @@ struct mutex_t { * Release the lock on the mutex. */ void (*unlock)(mutex_t *this); - + /** - * Destroy a mutex instance. - */ - void (*destroy)(mutex_t *this); + * Destroy a mutex instance. + */ + void (*destroy)(mutex_t *this); }; /** @@ -128,12 +128,15 @@ struct condvar_t { /** * Wait on a condvar until it gets signalized, or times out. - * + * + * The passed timeval should be calculated based on the time_monotonic() + * function. + * * @param mutex mutex to release while waiting - * @param time absolute time until timeout + * @param tv absolute time until timeout * @return TRUE if timed out, FALSE otherwise */ - bool (*timed_wait_abs)(condvar_t *this, mutex_t *mutex, timeval_t timeout); + bool (*timed_wait_abs)(condvar_t *this, mutex_t *mutex, timeval_t tv); /** * Wake up a single thread in a condvar. -- cgit v1.2.3