]> git.sesse.net Git - vlc/commitdiff
Simplification to avoid busy loops after process suspension
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 15 Sep 2007 17:19:00 +0000 (17:19 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 15 Sep 2007 17:19:00 +0000 (17:19 +0000)
modules/misc/screensaver.c

index 68723411bc771694f6aad79d7ecc12586c20e4d3..95ab05d266138394b42c64b01e4c0be8411a881e 100644 (file)
@@ -134,8 +134,6 @@ static void Deactivate( vlc_object_t *p_this )
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    mtime_t deadline = mdate();
-
 #ifdef HAVE_DBUS
     p_intf->p_sys->p_connection = dbus_init( p_intf );
 #endif
@@ -172,12 +170,10 @@ static void Run( intf_thread_t *p_intf )
             }
         }
 
-        vlc_mutex_lock( &p_intf->object_lock );
-
         /* Check screensaver every 30 seconds */
-        deadline += 30 * 1000000;
+        vlc_mutex_lock( &p_intf->object_lock );
         vlc_cond_timedwait( &p_intf->object_wait, &p_intf->object_lock,
-                            deadline );
+                            mdate() + 30000000 );
     }
     while( !p_intf->b_die );