Changeset 522baa537196376d0e517c68547a78bb830dddd7
- Timestamp:
- 05/29/08 18:08:49
(3 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1212077329 +0300
- git-parent:
[e3fa003bfa151ec22840ae6c2047e7c468761092]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1212077329 +0300
- Message:
Cleanup handling of thread-less interfaces
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r358c28c |
r522baa5 |
|
| 151 | 151 | int intf_RunThread( intf_thread_t *p_intf ) |
|---|
| 152 | 152 | { |
|---|
| 153 | | /* This interface doesn't need to be run */ |
|---|
| 154 | | if( p_intf->pf_run == NULL ) |
|---|
| 155 | | return VLC_SUCCESS; |
|---|
| 156 | | |
|---|
| 157 | 153 | /* Hack to get Mac OS X Cocoa runtime running |
|---|
| 158 | 154 | * (it needs access to the main thread) */ |
|---|
| … | … | |
| 187 | 183 | /* Tell the interface to die */ |
|---|
| 188 | 184 | vlc_object_kill( p_intf ); |
|---|
| 189 | | if( p_intf->pf_run != NULL ) |
|---|
| 190 | | { |
|---|
| 191 | | vlc_cond_signal( &p_intf->object_wait ); |
|---|
| 192 | | vlc_thread_join( p_intf ); |
|---|
| 193 | | } |
|---|
| | 185 | vlc_cond_signal( &p_intf->object_wait ); |
|---|
| | 186 | vlc_thread_join( p_intf ); |
|---|
| 194 | 187 | } |
|---|
| 195 | 188 | |
|---|
| … | … | |
| 230 | 223 | { |
|---|
| 231 | 224 | /* Give control to the interface */ |
|---|
| 232 | | p_intf->pf_run( p_intf ); |
|---|
| | 225 | if( p_intf->pf_run ) |
|---|
| | 226 | p_intf->pf_run( p_intf ); |
|---|
| | 227 | else |
|---|
| | 228 | while( vlc_object_lock_and_wait( p_intf ) == 0 ); |
|---|
| 233 | 229 | |
|---|
| 234 | 230 | /* Reset play on start status */ |
|---|
| re3fa003 |
r522baa5 |
|
| 1151 | 1151 | if( b_block ) |
|---|
| 1152 | 1152 | { |
|---|
| 1153 | | /* FIXME: should be moved to interface/interface.c */ |
|---|
| 1154 | | if( p_intf->pf_run ) |
|---|
| 1155 | | vlc_thread_join( p_intf ); |
|---|
| 1156 | | else |
|---|
| 1157 | | while( vlc_object_lock_and_wait( p_intf ) == 0 ); |
|---|
| 1158 | | |
|---|
| | 1153 | vlc_thread_join( p_intf ); |
|---|
| 1159 | 1154 | vlc_object_detach( p_intf ); |
|---|
| 1160 | 1155 | vlc_object_release( p_intf ); |
|---|