Commit 8d0e42ed authored by Laurent Aimar's avatar Laurent Aimar

Do not msleep to wait for a die order.

parent 253ac451
...@@ -502,24 +502,20 @@ static void* Run( vlc_object_t *p_this ) ...@@ -502,24 +502,20 @@ static void* Run( vlc_object_t *p_this )
{ {
/* If we failed, wait before we are killed, and exit */ /* If we failed, wait before we are killed, and exit */
WaitDie( p_input ); WaitDie( p_input );
goto exit;
/* Tell we're dead */
p_input->b_dead = true;
vlc_restorecancel( canc );
return NULL;
} }
MainLoop( p_input ); MainLoop( p_input );
/* Wait until we are asked to die */ /* Wait until we are asked to die */
if( !p_input->b_die ) if( !p_input->b_die )
{
WaitDie( p_input ); WaitDie( p_input );
}
/* Clean up */ /* Clean up */
End( p_input ); End( p_input );
exit:
p_input->b_dead = true;
vlc_restorecancel( canc ); vlc_restorecancel( canc );
return NULL; return NULL;
} }
...@@ -1306,11 +1302,12 @@ error: ...@@ -1306,11 +1302,12 @@ error:
static void WaitDie( input_thread_t *p_input ) static void WaitDie( input_thread_t *p_input )
{ {
input_ChangeState( p_input, p_input->b_error ? ERROR_S : END_S ); input_ChangeState( p_input, p_input->b_error ? ERROR_S : END_S );
while( !p_input->b_die )
{ /* Wait a die order */
/* Sleep a while */ vlc_object_lock( p_input );
msleep( INPUT_IDLE_SLEEP ); while( vlc_object_alive( p_input ) )
} vlc_object_wait( p_input );
vlc_object_unlock( p_input );
} }
/***************************************************************************** /*****************************************************************************
......
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