sscall

UDP based voice chat
git clone git://git.2f30.org/sscall
Log | Files | Refs | README | LICENSE

commit 62a114524176823681f08c88ef77db532672953b
parent 887a0f334f7ec21d2e5469385c0470565cf6cdc9
Author: sin <sin@2f30.org>
Date:   Mon,  4 Jun 2012 19:16:02 +0100

sscall: Re-arrange pthread termination for output thread


Diffstat:
Msscall.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sscall.c b/sscall.c @@ -419,17 +419,17 @@ main(int argc, char *argv[]) /* Wait for it */ pthread_join(input_pcm_thread, NULL); + /* Prepare output thread to be killed */ + pthread_mutex_lock(&kill_output_pcm_lock); + kill_output_pcm = 1; + pthread_mutex_unlock(&kill_output_pcm_lock); + /* Wake up the output thread if it is * sleeping */ pthread_mutex_lock(&pcm_buf_lock); pthread_cond_signal(&tx_pcm_cond); pthread_mutex_unlock(&pcm_buf_lock); - /* Prepare output thread to be killed */ - pthread_mutex_lock(&kill_output_pcm_lock); - kill_output_pcm = 1; - pthread_mutex_unlock(&kill_output_pcm_lock); - /* Wait for it */ pthread_join(output_pcm_thread, NULL);