Hi all,
7 of 8 ) Change input buffer driver to use new monotonic pthread interface.
Regards,
diff --git a/src/input/idirectfbinputbuffer.c
b/src/input/idirectfbinputbuffer.c
index 4eb437d..28f9d3e 100644
--- a/src/input/idirectfbinputbuffer.c
+++ b/src/input/idirectfbinputbuffer.c
@@ -268,7 +268,6 @@ IDirectFBEventBuffer_WaitForEventWithTimeout(
IDirectFBEventBuffer *thiz,
unsigned int
seconds,
unsigned int
milli_seconds )
{
- struct timeval now;
struct timespec timeout;
DFBResult ret = DFB_OK;
int locked = 0;
@@ -289,13 +288,7 @@ IDirectFBEventBuffer_WaitForEventWithTimeout(
IDirectFBEventBuffer *thiz,
locked = 1;
}
- gettimeofday( &now, NULL );
-
- timeout.tv_sec = now.tv_sec + seconds;
- timeout.tv_nsec = (now.tv_usec * 1000) + nano_seconds;
-
- timeout.tv_sec += timeout.tv_nsec / 1000000000;
- timeout.tv_nsec %= 1000000000;
+ direct_util_get_monotonic_pthread_timeout(&timeout, seconds,
nano_seconds);
if (!locked)
pthread_mutex_lock( &data->events_mutex );
@@ -659,7 +652,7 @@ IDirectFBEventBuffer_Construct(
IDirectFBEventBuffer *thiz,
data->filter_ctx = filter_ctx;
direct_util_recursive_pthread_mutex_init( &data->events_mutex );
- pthread_cond_init( &data->wait_condition, NULL );
+ direct_util_monotonic_pthread_cond_init( &data->wait_condition );
thiz->AddRef = IDirectFBEventBuffer_AddRef;
thiz->Release = IDirectFBEventBuffer_Release;
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev