Hi all,

6 of 8 ) Change voodoo to use new monotonic pthread interface.

Regards,


diff --git a/lib/voodoo/manager.c b/lib/voodoo/manager.c
index f36b9ce..2f3065f 100644
--- a/lib/voodoo/manager.c
+++ b/lib/voodoo/manager.c
@@ -226,9 +226,9 @@ voodoo_manager_create( int             fd,
      direct_util_recursive_pthread_mutex_init( &manager->output.lock );

      /* Initialize all wait conditions. */
-     pthread_cond_init( &manager->response.wait, NULL );
-     pthread_cond_init( &manager->input.wait, NULL );
-     pthread_cond_init( &manager->output.wait, NULL );
+     direct_util_monotonic_pthread_cond_init( &manager->response.wait );
+     direct_util_monotonic_pthread_cond_init( &manager->input.wait );
+     direct_util_monotonic_pthread_cond_init( &manager->output.wait );

      /* Set default buffer limit. */
      manager->input.max = IN_BUF_MAX;
@@ -1278,19 +1278,12 @@ manager_output_loop( DirectThread *thread, void 
*arg )
           pthread_mutex_lock( &manager->output.lock );

           while (manager->output.start == manager->output.end) {
-               struct timeval  now;
                struct timespec timeout;

                D_ASSUME( manager->output.start == 0 );
                D_ASSUME( manager->output.end == 0 );

-               gettimeofday( &now, NULL );
-
-               timeout.tv_sec  = now.tv_sec;
-               timeout.tv_nsec = (now.tv_usec + 50000) * 1000;
-
-               timeout.tv_sec  += timeout.tv_nsec / 1000000000;
-               timeout.tv_nsec %= 1000000000;
+               direct_util_get_monotonic_pthread_timeout(&timeout, 0, 
50000 * 1000);

                pthread_cond_timedwait( &manager->output.wait, 
&manager->output.lock, &timeout );




_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to