Changeset 1508936ffc9a5045a956b377cfb9f237f5e6afd6

Show
Ignore:
Timestamp:
15/09/07 20:00:22 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1189879222 +0000
git-parent:

[f56300d5e8f0fbbccadddf4c17460b8a58d4114c]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1189879222 +0000
Message:

Fix deadlock

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/misc/screensaver.c

    r1794ae7 r1508936  
    135135static void Run( intf_thread_t *p_intf ) 
    136136{ 
     137    vlc_bool_t b_quit = VLC_FALSE; 
     138 
    137139#ifdef HAVE_DBUS 
    138140    p_intf->p_sys->p_connection = dbus_init( p_intf ); 
    139141#endif 
    140142 
    141     do 
    142     { 
     143    while( !b_quit ) 
     144    { 
     145        /* Check screensaver every 30 seconds */ 
     146        vlc_mutex_lock( &p_intf->object_lock ); 
     147        vlc_cond_timedwait( &p_intf->object_wait, &p_intf->object_lock, 
     148                            mdate() + 30000000 ); 
     149        b_quit = p_intf->b_die; 
     150        vlc_mutex_unlock( &p_intf->object_lock ); 
     151 
    143152        vlc_object_t *p_vout; 
    144153        p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE ); 
     
    170179            } 
    171180        } 
    172  
    173         /* Check screensaver every 30 seconds */ 
    174         vlc_mutex_lock( &p_intf->object_lock ); 
    175         vlc_cond_timedwait( &p_intf->object_wait, &p_intf->object_lock, 
    176                             mdate() + 30000000 ); 
    177     } 
    178     while( !p_intf->b_die ); 
    179  
    180     vlc_mutex_unlock( &p_intf->object_lock ); 
     181    } 
    181182} 
    182183