]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix deadlock issues in dvr when recording is completed
authorAndreas Öman <andreas@lonelycoder.com>
Sun, 21 Sep 2008 18:16:14 +0000 (18:16 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sun, 21 Sep 2008 18:16:14 +0000 (18:16 +0000)
dvr/dvr_rec.c

index 32cc5886bf8e4cb4023ee54bb1f0aab7fdd24e41..997cd82a339a7f08ac169f0d1406d373c4d945d4 100644 (file)
@@ -444,6 +444,8 @@ dvr_rec_stop(dvr_entry_t *de)
   if(st->st_status == ST_RUNNING) {
     st->st_status = ST_STOP_REQ;
 
+    pthread_cond_signal(&st->st_cond);
+
     while(st->st_status != ST_ZOMBIE)
       pthread_cond_wait(&st->st_cond, &st->st_mutex);
   }
@@ -488,16 +490,16 @@ dvr_thread(void *aux)
     pthread_mutex_lock(&st->st_mutex);
   }
 
-  dvr_thread_epilog(de);
-
-  streaming_target_disconnect(&de->de_st);
-
   /* Signal back that we no longer is running */
   st->st_status = ST_ZOMBIE;
   pthread_cond_signal(&st->st_cond);
 
   pthread_mutex_unlock(&st->st_mutex);
 
+  dvr_thread_epilog(de);
+
+  streaming_target_disconnect(&de->de_st);
+
 
   pthread_mutex_lock(&global_lock);
   dvr_entry_dec_ref(de);                    /* Past this we may no longer