Changeset 187a6ea2ec52ec3624bd8478c7fc0c6a46fb43bf

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

[c17e7670f4f4e40e5da47f463852f1af833cf662]

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

Interfaces are now allowed not to have a Run function.
This will help reduce useless process wakeups

Files:

Legend:

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

    rc17e767 r187a6ea  
    3939static int  Open    ( vlc_object_t * ); 
    4040static void Close   ( vlc_object_t * ); 
    41 static void Run     ( intf_thread_t * ); 
    4241 
    4342static int ItemChange( vlc_object_t *, const char *, 
     
    4948 * Module descriptor 
    5049 ****************************************************************************/ 
    51  
    5250 
    5351#define APPLICATION_NAME "VLC media player" 
     
    8785    pl_Release( p_intf ); 
    8886 
    89     p_intf->pf_run = Run; 
    9087    return VLC_SUCCESS; 
    9188} 
     
    10198 
    10299    notify_uninit(); 
    103 } 
    104  
    105 /***************************************************************************** 
    106  * Run 
    107  *****************************************************************************/ 
    108 static void Run( intf_thread_t *p_this ) 
    109 { 
    110     msleep( 10*INTF_IDLE_SLEEP ); 
    111100} 
    112101 
  • src/interface/interface.c

    r224b28c r187a6ea  
    187187    else 
    188188    { 
     189        /* This interface doesn't need to be run */ 
     190        if( !p_intf->pf_run ) 
     191        { 
     192            return VLC_SUCCESS; 
     193        } 
    189194        /* Run the interface in a separate thread */ 
    190195        if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) 
     
    227232    else 
    228233    { 
     234        /* This interface doesn't need to be run */ 
     235        if( !p_intf->pf_run ) 
     236            return VLC_SUCCESS; 
     237 
    229238        /* Run the interface in a separate thread */ 
    230239        if( vlc_thread_create( p_intf, "interface", RunInterface, 
     
    256265 
    257266    /* Wait for the thread to exit */ 
    258     vlc_thread_join( p_intf ); 
     267    if( p_intf->pf_run ) 
     268        vlc_thread_join( p_intf ); 
    259269} 
    260270