Changeset 5f3d03fbbf20495f88f871776df3e8a1e0b6cebc
- Timestamp:
- 19/05/07 22:57:48
(2 years ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1179608268 +0000
- git-parent:
[acc91d372a52a64cda5128ed9defa26a654a332c]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1179608268 +0000
- Message:
Use static storage rather than libvlc_global for stuff that is only used in a single file.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0e39834 |
r5f3d03f |
|
| 28 | 28 | |
|---|
| 29 | 29 | #include <stdlib.h> |
|---|
| | 30 | #include "libvlc.h" |
|---|
| 30 | 31 | |
|---|
| 31 | 32 | #define VLC_THREADS_UNINITIALIZED 0 |
|---|
| … | … | |
| 45 | 46 | #elif defined( UNDER_CE ) |
|---|
| 46 | 47 | #elif defined( WIN32 ) |
|---|
| 47 | | #elif defined( HAVE_KERNEL_SCHEDULER_H ) |
|---|
| 48 | | #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) |
|---|
| 49 | | static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER; |
|---|
| | 48 | static SIGNALOBJECTANDWAIT SignalObjectAndWait = NULL; |
|---|
| | 49 | static vlc_bool_t b_fast_mutex = 0; |
|---|
| | 50 | static int i_win9x_cv = 0; |
|---|
| | 51 | #elif defined( HAVE_KERNEL_SCHEDULER_H ) |
|---|
| | 52 | #elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) |
|---|
| | 53 | static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER; |
|---|
| 50 | 54 | #elif defined( HAVE_CTHREADS_H ) |
|---|
| 51 | 55 | #endif |
|---|
| … | … | |
| 103 | 107 | if( hInstLib ) |
|---|
| 104 | 108 | { |
|---|
| 105 | | p_libvlc_global->SignalObjectAndWait = |
|---|
| | 109 | SignalObjectAndWait = |
|---|
| 106 | 110 | (SIGNALOBJECTANDWAIT)GetProcAddress( hInstLib, |
|---|
| 107 | 111 | "SignalObjectAndWait" ); |
|---|
| 108 | 112 | } |
|---|
| 109 | 113 | } |
|---|
| 110 | | else |
|---|
| 111 | | { |
|---|
| 112 | | p_libvlc_global->SignalObjectAndWait = NULL; |
|---|
| 113 | | } |
|---|
| 114 | | |
|---|
| 115 | | p_libvlc_global->b_fast_mutex = 0; |
|---|
| 116 | | p_libvlc_global->i_win9x_cv = 0; |
|---|
| 117 | 114 | |
|---|
| 118 | 115 | #elif defined( HAVE_KERNEL_SCHEDULER_H ) |
|---|
| … | … | |
| 237 | 234 | * As this function is not available on Win9x, we can use the faster |
|---|
| 238 | 235 | * CriticalSections */ |
|---|
| 239 | | if( p_this->p_libvlc_global->SignalObjectAndWait && |
|---|
| 240 | | !p_this->p_libvlc_global->b_fast_mutex ) |
|---|
| | 236 | if( SignalObjectAndWait && !b_fast_mutex ) |
|---|
| 241 | 237 | { |
|---|
| 242 | 238 | /* We are running on NT/2K/XP, we can use SignalObjectAndWait */ |
|---|
| … | … | |
| 387 | 383 | |
|---|
| 388 | 384 | /* Misc init */ |
|---|
| 389 | | p_condvar->i_win9x_cv = p_this->p_libvlc_global->i_win9x_cv; |
|---|
| 390 | | p_condvar->SignalObjectAndWait = p_this->p_libvlc_global->SignalObjectAndWait; |
|---|
| 391 | | |
|---|
| 392 | | if( (p_condvar->SignalObjectAndWait && |
|---|
| 393 | | !p_this->p_libvlc_global->b_fast_mutex) |
|---|
| | 385 | p_condvar->i_win9x_cv = i_win9x_cv; |
|---|
| | 386 | p_condvar->SignalObjectAndWait = SignalObjectAndWait; |
|---|
| | 387 | |
|---|
| | 388 | if( (p_condvar->SignalObjectAndWait && !b_fast_mutex) |
|---|
| 394 | 389 | || p_condvar->i_win9x_cv == 0 ) |
|---|
| 395 | 390 | { |
|---|