Changeset 353ece46279797b5684fafdfc135b9104591fbc9

Show
Ignore:
Timestamp:
24/09/06 12:40:00 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1159094400 +0000
git-parent:

[a06213d7f406c886dba790418ef8cca43d7ad140]

git-author:
Clément Stenac <zorglub@videolan.org> 1159094400 +0000
Message:

Convert hotkeys to using cond_wait/cond_signal
This removes useless wakeups and improves hotkeys reactivity

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/control/hotkeys.c

    ra06213d r353ece4  
    171171 
    172172        /* Sleep a bit */ 
    173         msleep( INTF_IDLE_SLEEP ); 
     173//        msleep( INTF_IDLE_SLEEP ); 
    174174 
    175175        /* Update the input */ 
     
    229229        if( !i_action ) 
    230230        { 
     231            vlc_mutex_lock( &p_intf->object_lock ); 
     232            vlc_cond_wait( &p_intf->object_wait, &p_intf->object_lock ); 
     233            vlc_mutex_unlock( &p_intf->object_lock ); 
    231234            /* No key pressed, sleep a bit more */ 
    232             msleep( INTF_IDLE_SLEEP ); 
     235//            msleep( INTF_IDLE_SLEEP ); 
    233236            continue; 
    234237        } 
     
    747750        p_intf->p_sys->i_size++; 
    748751    } 
     752    vlc_mutex_lock( &p_intf->object_lock ); 
     753    vlc_cond_signal( &p_intf->object_wait ); 
     754    vlc_mutex_unlock( &p_intf->object_lock ); 
    749755    vlc_mutex_unlock( &p_intf->p_sys->change_lock ); 
    750756 
  • src/interface/interface.c

    ra06213d r353ece4  
    262262        p_intf->b_die = VLC_TRUE; 
    263263        if( p_intf->pf_run ) 
     264        { 
     265            vlc_cond_signal( &p_intf->object_wait ); 
    264266            vlc_thread_join( p_intf ); 
     267        } 
    265268    } 
    266269}