Changeset 63baa1df69663f280e010d58e5fdc5f740e3a4c0

Show
Ignore:
Timestamp:
04/23/08 20:33:45 (4 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1208975625 +0300
git-parent:

[14d8baf7996e1be2705c8d029cd415784d6c2371]

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

Win32: don't use weak linking for SignalObjectAndWait?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_threads.h

    rcc6e3d0 r63baa1d  
    141141    /* WinNT/2K/XP implementation */ 
    142142    HANDLE              event; 
    143     SIGNALOBJECTANDWAIT SignalObjectAndWait; 
    144143    /* Win95/98/ME implementation */ 
    145144    HANDLE              semaphore; 
  • include/vlc_threads_funcs.h

    r449fd28 r63baa1d  
    283283        if( p_mutex->mutex ) 
    284284        { 
    285             /* It is only possible to atomically release the mutex and 
    286              * initiate the waiting on WinNT/2K/XP. Win9x doesn't have 
    287              * SignalObjectAndWait(). */ 
    288             p_condvar->SignalObjectAndWait( p_mutex->mutex, 
    289                                             p_condvar->event, 
    290                                             INFINITE, FALSE ); 
     285            SignalObjectAndWait( p_mutex->mutex, p_condvar->event, 
     286                                 INFINITE, FALSE ); 
    291287        } 
    292288        else 
     
    415411        if( p_mutex->mutex ) 
    416412        { 
    417             /* It is only possible to atomically release the mutex and 
    418              * initiate the waiting on WinNT/2K/XP. Win9x doesn't have 
    419              * SignalObjectAndWait(). */ 
    420             result = p_condvar->SignalObjectAndWait( p_mutex->mutex, 
    421                                             p_condvar->event, 
    422                                             delay_ms, FALSE ); 
     413            result = SignalObjectAndWait( p_mutex->mutex, p_condvar->event, 
     414                                          delay_ms, FALSE ); 
    423415        } 
    424416        else 
  • src/misc/threads.c

    r449fd28 r63baa1d  
    5252#elif defined( WIN32 ) 
    5353 
    54 /* following is only available on NT/2000/XP and above */ 
    55 static SIGNALOBJECTANDWAIT pf_SignalObjectAndWait = NULL; 
    56  
    5754/* 
    5855** On Windows NT/2K/XP we use a slow mutex implementation but which 
     
    165162        p_libvlc_global->b_ready = false; 
    166163 
    167 #if defined( UNDER_CE ) 
    168         /* Nothing to initialize */ 
    169  
    170 #elif defined( WIN32 ) 
    171         /* Dynamically get the address of SignalObjectAndWait */ 
    172         if( GetVersion() < 0x80000000 ) 
    173         { 
    174             HINSTANCE hInstLib; 
    175  
    176             /* We are running on NT/2K/XP, we can use SignalObjectAndWait */ 
    177             hInstLib = LoadLibrary(_T("kernel32")); 
    178             if( hInstLib ) 
    179             { 
    180                 pf_SignalObjectAndWait = 
    181                     (SIGNALOBJECTANDWAIT)GetProcAddress( hInstLib, 
    182                                                   _T("SignalObjectAndWait") ); 
    183             } 
    184         } 
    185  
    186 #elif defined( HAVE_KERNEL_SCHEDULER_H ) 
    187 #elif defined( LIBVLC_USE_PTHREAD ) 
    188 #endif 
    189  
    190164        p_root = vlc_custom_create( VLC_OBJECT(p_libvlc_global), 0, 
    191165                                    VLC_OBJECT_GLOBAL, "global" ); 
     
    280254 
    281255#elif defined( WIN32 ) 
    282     /* We use mutexes on WinNT/2K/XP because we can use the SignalObjectAndWait 
    283      * function and have a 100% correct vlc_cond_wait() implementation. 
    284      * As this function is not available on Win9x, we can use the faster 
    285      * CriticalSections */ 
    286     if( pf_SignalObjectAndWait && !b_fast_mutex ) 
    287     { 
    288         /* We are running on NT/2K/XP, we can use SignalObjectAndWait */ 
     256    if( !b_fast_mutex ) 
     257    { 
    289258        p_mutex->mutex = CreateMutex( 0, FALSE, 0 ); 
    290259        return ( p_mutex->mutex != NULL ? 0 : 1 ); 
     
    427396    /* Misc init */ 
    428397    p_condvar->i_win9x_cv = i_win9x_cv; 
    429     p_condvar->SignalObjectAndWait = pf_SignalObjectAndWait; 
    430  
    431     if( (p_condvar->SignalObjectAndWait && !b_fast_mutex) 
    432         || p_condvar->i_win9x_cv == 0 ) 
     398 
     399    if( !b_fast_mutex || p_condvar->i_win9x_cv == 0 ) 
    433400    { 
    434401        /* Create an auto-reset event. */