Commit 72d46b6b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove now useless vlc_exit_t.killed

parent a41e978c
...@@ -76,7 +76,6 @@ typedef struct vlc_exit ...@@ -76,7 +76,6 @@ typedef struct vlc_exit
vlc_mutex_t lock; vlc_mutex_t lock;
void (*handler) (void *); void (*handler) (void *);
void *opaque; void *opaque;
bool killed;
} vlc_exit_t; } vlc_exit_t;
void vlc_ExitInit( vlc_exit_t * ); void vlc_ExitInit( vlc_exit_t * );
......
...@@ -32,7 +32,6 @@ void vlc_ExitInit( vlc_exit_t *exit ) ...@@ -32,7 +32,6 @@ void vlc_ExitInit( vlc_exit_t *exit )
vlc_mutex_init( &exit->lock ); vlc_mutex_init( &exit->lock );
exit->handler = NULL; exit->handler = NULL;
exit->opaque = NULL; exit->opaque = NULL;
exit->killed = false;
} }
void vlc_ExitDestroy( vlc_exit_t *exit ) void vlc_ExitDestroy( vlc_exit_t *exit )
...@@ -50,8 +49,6 @@ void libvlc_SetExitHandler( libvlc_int_t *p_libvlc, void (*handler) (void *), ...@@ -50,8 +49,6 @@ void libvlc_SetExitHandler( libvlc_int_t *p_libvlc, void (*handler) (void *),
vlc_exit_t *exit = &libvlc_priv( p_libvlc )->exit; vlc_exit_t *exit = &libvlc_priv( p_libvlc )->exit;
vlc_mutex_lock( &exit->lock ); vlc_mutex_lock( &exit->lock );
if( exit->killed && handler != NULL ) /* already exited (race condition) */
handler( opaque );
exit->handler = handler; exit->handler = handler;
exit->opaque = opaque; exit->opaque = opaque;
vlc_mutex_unlock( &exit->lock ); vlc_mutex_unlock( &exit->lock );
...@@ -65,13 +62,11 @@ void libvlc_Quit( libvlc_int_t *p_libvlc ) ...@@ -65,13 +62,11 @@ void libvlc_Quit( libvlc_int_t *p_libvlc )
{ {
vlc_exit_t *exit = &libvlc_priv( p_libvlc )->exit; vlc_exit_t *exit = &libvlc_priv( p_libvlc )->exit;
msg_Dbg( p_libvlc, "exiting" );
vlc_mutex_lock( &exit->lock ); vlc_mutex_lock( &exit->lock );
if( !exit->killed ) if( exit->handler != NULL )
{ exit->handler( exit->opaque );
msg_Dbg( p_libvlc, "exiting" ); else
exit->killed = true; msg_Dbg( p_libvlc, "no exit handler" );
if( exit->handler != NULL )
exit->handler( exit->opaque );
}
vlc_mutex_unlock( &exit->lock ); vlc_mutex_unlock( &exit->lock );
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment