[SCM] gsequencer/master: added final fix available

jkraehemann-guest at users.alioth.debian.org jkraehemann-guest at users.alioth.debian.org
Sun Feb 5 14:58:24 UTC 2017


The following commit has been merged in the master branch:
commit c34a0ee4b0ee95bbb40207f3f69e8c1cbd0a0f93
Author: Joël Krähemann <jkraehemann-guest at users.alioth.debian.org>
Date:   Sun Feb 5 15:11:56 2017 +0100

    added final fix available

diff --git a/debian/patches/fix-thread-posix.patch b/debian/patches/fix-thread-posix.patch
new file mode 100644
index 0000000..1570318
--- /dev/null
+++ b/debian/patches/fix-thread-posix.patch
@@ -0,0 +1,146 @@
+Description: This patch is considered critical since it fixes the beginning
+ of the data-race. It has a strong relation with soundcard output. Since
+ the start of threads has some uncertainity about when it is ready.
+ This is the definitive fix available.
+Author: Joël Krähmann <jkraehemann at gmail.com>
+Applied-Upstream: 0.7.122.x, http://git.savannah.gnu.org/cgit/gsequencer.git
+Last-Update: 2017-02-05
+--- a/ags/thread/ags_thread-posix.c
++++ b/ags/thread/ags_thread-posix.c
+@@ -533,6 +533,14 @@
+       thread->freq = freq;
+       thread->delay = (guint) ceil((AGS_THREAD_HERTZ_JIFFIE / thread->freq) / (AGS_THREAD_HERTZ_JIFFIE / AGS_THREAD_MAX_PRECISION));
+       thread->tic_delay = 0;
++
++      if((AGS_THREAD_INTERMEDIATE_POST_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
++	thread->tic_delay = thread->delay;
++      }else if((AGS_THREAD_INTERMEDIATE_PRE_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
++	thread->tic_delay = 1;
++      }else{
++	thread->tic_delay = 0;
++      }
+     }
+     break;
+   default:
+@@ -2286,26 +2294,33 @@
+ 	 g_atomic_pointer_get(&(thread->parent)) != NULL){
+ 	AgsThread *chaos_tree;
+ 	
+-	chaos_tree = ags_thread_chaos_tree(thread);
++	chaos_tree = main_loop;//ags_thread_chaos_tree(thread);
++
++	/* ordinary sync */
++	thread->tic_delay = chaos_tree->tic_delay;
+ 
+-	/* set tic delay */
+ 	if((AGS_THREAD_INTERMEDIATE_PRE_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
+-	  /* intermediate pre sync */
+-	  if(chaos_tree->tic_delay > 0){
+-	    thread->tic_delay = chaos_tree->tic_delay - 1;
++	  if(thread->freq >= AGS_THREAD_MAX_PRECISION){
++	    thread->tic_delay = 0;
+ 	  }else{
+-	    thread->tic_delay = thread->delay;
++	    if(thread->tic_delay < thread->delay){
++	      thread->tic_delay++;
++	    }else{
++	      thread->tic_delay = 0;
++	    }
+ 	  }
+-	}else if((AGS_THREAD_INTERMEDIATE_POST_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
+-	  /* intermediate post sync */
+-	  if(chaos_tree->tic_delay < thread->delay){
+-	    thread->tic_delay = chaos_tree->tic_delay + 1;
+-	  }else{
++	}
++	
++	if((AGS_THREAD_INTERMEDIATE_POST_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
++	  if(thread->freq >= AGS_THREAD_MAX_PRECISION){
+ 	    thread->tic_delay = 0;
++	  }else{
++	    if(thread->tic_delay > 0){
++	      thread->tic_delay--;
++	    }else{
++	      thread->tic_delay = thread->delay;
++	    }
+ 	  }
+-	}else{
+-	  /* ordinary sync */
+-	  thread->tic_delay = chaos_tree->tic_delay;
+ 	}
+ 	
+ 	g_atomic_int_or(&(thread->flags),
+@@ -2842,8 +2857,34 @@
+ 
+ 	pthread_mutex_lock(ags_main_loop_get_tree_lock(AGS_MAIN_LOOP(main_loop)));
+ 
++	/* ordinary sync */
+ 	queued_thread->tic_delay = thread->tic_delay;
+ 
++	if((AGS_THREAD_INTERMEDIATE_PRE_SYNC & (g_atomic_int_get(&(queued_thread->flags)))) != 0){
++	  if(queued_thread->freq >= AGS_THREAD_MAX_PRECISION){
++	    queued_thread->tic_delay = 0;
++	  }else{
++	    if(queued_thread->tic_delay < queued_thread->delay){
++	      queued_thread->tic_delay++;
++	    }else{
++	      queued_thread->tic_delay = 0;
++	    }
++	  }
++	}
++	
++	if((AGS_THREAD_INTERMEDIATE_POST_SYNC & (g_atomic_int_get(&(queued_thread->flags)))) != 0){
++	  if(queued_thread->freq >= AGS_THREAD_MAX_PRECISION){
++	    queued_thread->tic_delay = 0;
++	  }else{
++	    if(queued_thread->tic_delay > 0){
++	      queued_thread->tic_delay--;
++	    }else{
++	      queued_thread->tic_delay = queued_thread->delay;
++	    }
++	  }
++	}
++
++	/*  */
+ 	pthread_mutex_unlock(ags_main_loop_get_tree_lock(AGS_MAIN_LOOP(main_loop)));
+ 	
+ 	g_atomic_int_set(&(queued_thread->start_wait),
+@@ -3094,8 +3135,37 @@
+ 
+   if((AGS_THREAD_INITIAL_RUN & (g_atomic_int_get(&(thread->flags)))) != 0  ||
+      (AGS_THREAD_INITIAL_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
+-    thread->current_tic = ags_main_loop_get_tic(AGS_MAIN_LOOP(main_loop));    
++    AgsThread *chaos_tree;
++	
++    chaos_tree = main_loop;//ags_thread_chaos_tree(thread);
++
++    /* ordinary sync */
++    thread->tic_delay = chaos_tree->tic_delay;
+ 
++    if((AGS_THREAD_INTERMEDIATE_PRE_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
++      if(thread->freq >= AGS_THREAD_MAX_PRECISION){
++	thread->tic_delay = 0;
++      }else{
++	if(thread->tic_delay > 0){
++	  thread->tic_delay--;
++	}else{
++	  thread->tic_delay = thread->delay;
++	}
++      }
++    }
++	
++    if((AGS_THREAD_INTERMEDIATE_POST_SYNC & (g_atomic_int_get(&(thread->flags)))) != 0){
++      if(thread->freq >= AGS_THREAD_MAX_PRECISION){
++	thread->tic_delay = 0;
++      }else{
++	if(thread->tic_delay < thread->delay){
++	  thread->tic_delay++;
++	}else{
++	  thread->tic_delay = 0;
++	}
++      }
++    }
++	
+     g_atomic_int_and(&(thread->flags),
+ 		     (~AGS_THREAD_INITIAL_RUN));
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 391dbf0..1c44e4e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -50,3 +50,4 @@ fix-copy-pattern-channel-run.patch
 fix-clear-buffer-h.patch
 fix-clear-buffer-c.patch
 fix-devout.patch
+fix-thread-posix.patch

-- 
gsequencer packaging



More information about the pkg-multimedia-commits mailing list