Skip to content

Commit

Permalink
android thread: do not init the "finished" semaphore in the case of a…
Browse files Browse the repository at this point in the history
… detached thread.

This commit prevents the leak of the semaphore.
  • Loading branch information
magwyz committed Jun 12, 2014
1 parent c47334a commit bb9e60e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/android/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ static int vlc_clone_attr (vlc_thread_t *th, void *(*entry) (void *),
pthread_sigmask (SIG_BLOCK, &set, &oldset);
}


vlc_sem_init(&thread->finished, 0);
if (!detach)
vlc_sem_init(&thread->finished, 0);
atomic_store(&thread->killed, false);
thread->killable = true;
thread->cond = NULL;
Expand Down

0 comments on commit bb9e60e

Please sign in to comment.