diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-01-29 21:15:32 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2007-01-29 21:15:32 +0000 |
commit | 17979ae99228dd0422c26e366d6453663b9664a4 (patch) | |
tree | 589dc742d8fbfdbdd034517dbbccc0e290789047 /recordmydesktop/src/rmdthreads.c | |
parent | 6ddb091a949d1c7ef107307aedf980bc34f6aa57 (diff) |
Fixed all condition variables, to be waited with correct mutexes.
This fixed also the wakeup from pause bug.
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@269 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rmdthreads.c')
-rw-r--r-- | recordmydesktop/src/rmdthreads.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/recordmydesktop/src/rmdthreads.c b/recordmydesktop/src/rmdthreads.c index 442c67e..4199472 100644 --- a/recordmydesktop/src/rmdthreads.c +++ b/recordmydesktop/src/rmdthreads.c @@ -96,7 +96,9 @@ void rmdThreads(ProgData *pdata){ //if no damage events have been received the thread will get stuck while(!pdata->th_enc_thread_waiting && !pdata->th_encoding_clean){ usleep(10000); + pthread_mutex_lock(&pdata->img_buff_ready_mutex); pthread_cond_signal(&pdata->image_buffer_ready); + pthread_mutex_unlock(&pdata->img_buff_ready_mutex); } if(pdata->args.encOnTheFly){ @@ -110,7 +112,9 @@ void rmdThreads(ProgData *pdata){ fprintf(stderr,"."); while(!pdata->v_enc_thread_waiting && !pdata->v_encoding_clean){ usleep(10000); + pthread_mutex_lock(&pdata->snd_buff_ready_mutex); pthread_cond_signal(&pdata->sound_data_read); + pthread_mutex_unlock(&pdata->snd_buff_ready_mutex); } if(pdata->args.encOnTheFly){ pthread_join(sound_encode_t,NULL); |