Commit 7b98a5d8 authored by Steve Lhomme's avatar Steve Lhomme Committed by Rémi Denis-Courmont

background_worker: use a define for the inactive worker deadline

Modified-and-...
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 16110743
......@@ -74,7 +74,7 @@ static void* Thread( void* data )
vlc_array_remove( &worker->tail.data, 0 );
}
if( worker->head.deadline == VLC_TS_0 && item == NULL )
if( worker->head.deadline == VLC_TS_INVALID && item == NULL )
worker->head.active = false;
worker->head.id = item ? item->id : NULL;
vlc_cond_broadcast( &worker->head.wait );
......@@ -86,7 +86,7 @@ static void* Thread( void* data )
else
worker->head.deadline = INT64_MAX;
}
else if( worker->head.deadline != VLC_TS_0 )
else if( worker->head.deadline != VLC_TS_INVALID )
{
/* Wait 1 seconds for new inputs before terminating */
mtime_t deadline = mdate() + INT64_C(1000000);
......@@ -96,7 +96,7 @@ static void* Thread( void* data )
{
/* Timeout: if there is still no items, the thread will be
* terminated at next loop iteration (active = false). */
worker->head.deadline = VLC_TS_0;
worker->head.deadline = VLC_TS_INVALID;
}
continue;
}
......@@ -173,7 +173,7 @@ static void BackgroundWorkerCancel( struct background_worker* worker, void* id)
while( ( id == NULL && worker->head.active )
|| ( id != NULL && worker->head.id == id ) )
{
worker->head.deadline = VLC_TS_0;
worker->head.deadline = VLC_TS_INVALID;
vlc_cond_signal( &worker->head.worker_wait );
vlc_cond_signal( &worker->tail.wait );
vlc_cond_wait( &worker->head.wait, &worker->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