diff options
author | Martin Willi <martin@strongswan.org> | 2009-08-31 15:13:48 +0200 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-08-31 15:13:48 +0200 |
commit | 3d5818ec38c464b24f382d88c70b10df6c04b160 (patch) | |
tree | 58b41fa9794a8677757d642c10bc33e50bb9c438 /src/libstrongswan/utils/mutex.h | |
parent | 3f310c0d1f664f5811327c5a89b5d6c2f3e42bdc (diff) | |
download | strongswan-3d5818ec38c464b24f382d88c70b10df6c04b160.tar.bz2 strongswan-3d5818ec38c464b24f382d88c70b10df6c04b160.tar.xz |
use monotonic time source in convar->timed_wait, and in the scheduler using it
Diffstat (limited to 'src/libstrongswan/utils/mutex.h')
-rw-r--r-- | src/libstrongswan/utils/mutex.h | 17 |
1 files changed, 10 insertions, 7 deletions
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. |