Changeset 187a6ea2ec52ec3624bd8478c7fc0c6a46fb43bf
- 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
| rc17e767 |
r187a6ea |
|
| 39 | 39 | static int Open ( vlc_object_t * ); |
|---|
| 40 | 40 | static void Close ( vlc_object_t * ); |
|---|
| 41 | | static void Run ( intf_thread_t * ); |
|---|
| 42 | 41 | |
|---|
| 43 | 42 | static int ItemChange( vlc_object_t *, const char *, |
|---|
| … | … | |
| 49 | 48 | * Module descriptor |
|---|
| 50 | 49 | ****************************************************************************/ |
|---|
| 51 | | |
|---|
| 52 | 50 | |
|---|
| 53 | 51 | #define APPLICATION_NAME "VLC media player" |
|---|
| … | … | |
| 87 | 85 | pl_Release( p_intf ); |
|---|
| 88 | 86 | |
|---|
| 89 | | p_intf->pf_run = Run; |
|---|
| 90 | 87 | return VLC_SUCCESS; |
|---|
| 91 | 88 | } |
|---|
| … | … | |
| 101 | 98 | |
|---|
| 102 | 99 | notify_uninit(); |
|---|
| 103 | | } |
|---|
| 104 | | |
|---|
| 105 | | /***************************************************************************** |
|---|
| 106 | | * Run |
|---|
| 107 | | *****************************************************************************/ |
|---|
| 108 | | static void Run( intf_thread_t *p_this ) |
|---|
| 109 | | { |
|---|
| 110 | | msleep( 10*INTF_IDLE_SLEEP ); |
|---|
| 111 | 100 | } |
|---|
| 112 | 101 | |
|---|
| r224b28c |
r187a6ea |
|
| 187 | 187 | else |
|---|
| 188 | 188 | { |
|---|
| | 189 | /* This interface doesn't need to be run */ |
|---|
| | 190 | if( !p_intf->pf_run ) |
|---|
| | 191 | { |
|---|
| | 192 | return VLC_SUCCESS; |
|---|
| | 193 | } |
|---|
| 189 | 194 | /* Run the interface in a separate thread */ |
|---|
| 190 | 195 | if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) ) |
|---|
| … | … | |
| 227 | 232 | else |
|---|
| 228 | 233 | { |
|---|
| | 234 | /* This interface doesn't need to be run */ |
|---|
| | 235 | if( !p_intf->pf_run ) |
|---|
| | 236 | return VLC_SUCCESS; |
|---|
| | 237 | |
|---|
| 229 | 238 | /* Run the interface in a separate thread */ |
|---|
| 230 | 239 | if( vlc_thread_create( p_intf, "interface", RunInterface, |
|---|
| … | … | |
| 256 | 265 | |
|---|
| 257 | 266 | /* Wait for the thread to exit */ |
|---|
| 258 | | vlc_thread_join( p_intf ); |
|---|
| | 267 | if( p_intf->pf_run ) |
|---|
| | 268 | vlc_thread_join( p_intf ); |
|---|
| 259 | 269 | } |
|---|
| 260 | 270 | |
|---|