Changeset 63baa1df69663f280e010d58e5fdc5f740e3a4c0
- 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
| rcc6e3d0 |
r63baa1d |
|
| 141 | 141 | /* WinNT/2K/XP implementation */ |
|---|
| 142 | 142 | HANDLE event; |
|---|
| 143 | | SIGNALOBJECTANDWAIT SignalObjectAndWait; |
|---|
| 144 | 143 | /* Win95/98/ME implementation */ |
|---|
| 145 | 144 | HANDLE semaphore; |
|---|
| r449fd28 |
r63baa1d |
|
| 283 | 283 | if( p_mutex->mutex ) |
|---|
| 284 | 284 | { |
|---|
| 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 ); |
|---|
| 291 | 287 | } |
|---|
| 292 | 288 | else |
|---|
| … | … | |
| 415 | 411 | if( p_mutex->mutex ) |
|---|
| 416 | 412 | { |
|---|
| 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 ); |
|---|
| 423 | 415 | } |
|---|
| 424 | 416 | else |
|---|
| r449fd28 |
r63baa1d |
|
| 52 | 52 | #elif defined( WIN32 ) |
|---|
| 53 | 53 | |
|---|
| 54 | | /* following is only available on NT/2000/XP and above */ |
|---|
| 55 | | static SIGNALOBJECTANDWAIT pf_SignalObjectAndWait = NULL; |
|---|
| 56 | | |
|---|
| 57 | 54 | /* |
|---|
| 58 | 55 | ** On Windows NT/2K/XP we use a slow mutex implementation but which |
|---|
| … | … | |
| 165 | 162 | p_libvlc_global->b_ready = false; |
|---|
| 166 | 163 | |
|---|
| 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 | | |
|---|
| 190 | 164 | p_root = vlc_custom_create( VLC_OBJECT(p_libvlc_global), 0, |
|---|
| 191 | 165 | VLC_OBJECT_GLOBAL, "global" ); |
|---|
| … | … | |
| 280 | 254 | |
|---|
| 281 | 255 | #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 | { |
|---|
| 289 | 258 | p_mutex->mutex = CreateMutex( 0, FALSE, 0 ); |
|---|
| 290 | 259 | return ( p_mutex->mutex != NULL ? 0 : 1 ); |
|---|
| … | … | |
| 427 | 396 | /* Misc init */ |
|---|
| 428 | 397 | 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 ) |
|---|
| 433 | 400 | { |
|---|
| 434 | 401 | /* Create an auto-reset event. */ |
|---|