Commit 1571438c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Android: fix potentially dangling condition variable pointer

This partially reverts commit e9ffcf98.
parent 30ab1259
......@@ -255,13 +255,9 @@ void vlc_cond_wait (vlc_cond_t *condvar, vlc_mutex_t *p_mutex)
if (th != NULL)
{
if (vlc_mutex_trylock (&th->lock) == 0)
{
thread->cond = NULL;
vlc_mutex_unlock (&th->lock);
}
/* Else: This thread was cancelled and is cancellable.
vlc_testcancel() will take of it right there: */
vlc_mutex_lock(&th->lock);
th->cond = NULL;
vlc_mutex_unlock(&th->lock);
vlc_testcancel();
}
}
......@@ -316,13 +312,9 @@ int vlc_cond_timedwait (vlc_cond_t *condvar, vlc_mutex_t *p_mutex,
if (th != NULL)
{
if (vlc_mutex_trylock (&th->lock) == 0)
{
thread->cond = NULL;
vlc_mutex_unlock (&th->lock);
}
/* Else: This thread was cancelled and is cancellable.
vlc_testcancel() will take of it right there: */
vlc_mutex_lock(&th->lock);
th->cond = NULL;
vlc_mutex_unlock(&th->lock);
vlc_testcancel();
}
return val;
......
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