[vlc-commits] [Git][videolan/vlc][master] 2 commits: os2: remove dead code
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Tue Sep 28 13:53:52 UTC 2021
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
f8476cf3 by Rémi Denis-Courmont at 2021-09-28T13:21:43+00:00
os2: remove dead code
Since LIBVLC_NEED_SLEEP is not defined, these functions are never used.
- - - - -
426e1ea3 by Rémi Denis-Courmont at 2021-09-28T13:21:43+00:00
os2: remove unused lock and pointer
- - - - -
1 changed file:
- src/os2/thread.c
Changes:
=====================================
src/os2/thread.c
=====================================
@@ -74,12 +74,6 @@ struct vlc_thread
void *(*entry) (void *);
void *data;
-
- struct
- {
- atomic_uint *addr;
- HMTX lock;
- } wait;
};
static void vlc_cancel_self (PVOID dummy);
@@ -453,7 +447,6 @@ int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *),
th->killable = false; /* not until vlc_entry() ! */
atomic_init (&th->killed, false);
th->cleaners = NULL;
- th->wait.addr = NULL;
if( DosCreateEventSem (NULL, &th->cancel_event, 0, FALSE))
goto error;
@@ -464,9 +457,6 @@ int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *),
if( th->cancel_sock < 0 )
goto error;
- if( DosCreateMutexSem (NULL, &th->wait.lock, 0, FALSE))
- goto error;
-
th->tid = _beginthread (vlc_entry, NULL, 1024 * 1024, th);
if((int)th->tid == -1)
goto error;
@@ -487,7 +477,6 @@ int vlc_clone (vlc_thread_t *p_handle, void *(*entry) (void *),
return 0;
error:
- DosCloseMutexSem (th->wait.lock);
soclose (th->cancel_sock);
DosCloseEventSem (th->cancel_event);
DosCloseEventSem (th->done_event);
@@ -514,8 +503,6 @@ void vlc_join (vlc_thread_t th, void **result)
soclose( th->cancel_sock );
- DosCloseMutexSem( th->wait.lock );
-
free( th );
}
@@ -549,14 +536,6 @@ void vlc_cancel (vlc_thread_t th)
{
atomic_store_explicit( &th->killed, true, memory_order_relaxed );
- DosRequestMutexSem( th->wait.lock, SEM_INDEFINITE_WAIT );
- if( th->wait.addr != NULL )
- {
- atomic_fetch_or_explicit( th->wait.addr, 1, memory_order_relaxed );
- vlc_atomic_notify_all( th->wait.addr );
- }
- DosReleaseMutexSem( th->wait.lock );
-
DosPostEventSem( th->cancel_event );
so_cancel( th->cancel_sock );
}
@@ -636,30 +615,6 @@ void vlc_control_cancel (vlc_cleanup_t *cleaner)
}
}
-void vlc_cancel_addr_set( atomic_uint *addr )
-{
- struct vlc_thread *th = vlc_threadvar_get( thread_key );
- if( th == NULL )
- return; /* Main thread - cannot be cancelled anyway */
-
- DosRequestMutexSem( th->wait.lock, SEM_INDEFINITE_WAIT );
- assert( th->wait.addr == NULL );
- th->wait.addr = addr;
- DosReleaseMutexSem( th->wait.lock );
-}
-
-void vlc_cancel_addr_clear( atomic_uint *addr )
-{
- struct vlc_thread *th = vlc_threadvar_get( thread_key );
- if( th == NULL )
- return; /* Main thread - cannot be cancelled anyway */
-
- DosRequestMutexSem( th->wait.lock, SEM_INDEFINITE_WAIT );
- assert( th->wait.addr == addr );
- th->wait.addr = NULL;
- DosReleaseMutexSem( th->wait.lock );
-}
-
static int vlc_select( int nfds, fd_set *rdset, fd_set *wrset, fd_set *exset,
struct timeval *timeout )
{
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/13282687881f743ac31b5f8db8e1f94111058196...426e1ea3b0d3e42abd275e102a13c36f0b3ede5f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/13282687881f743ac31b5f8db8e1f94111058196...426e1ea3b0d3e42abd275e102a13c36f0b3ede5f
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list