 --- gcc-4.5.4-orig/libstdc++-v3/include/parallel/partition.h	2011-02-25 09:04:40.000000000 -0500
-+++ gcc-4.5.4/libstdc++-v3/include/parallel/partition.h	2013-03-06 16:26:54.701793837 -0500
++++ gcc-4.5.4/libstdc++-v3/include/parallel/partition.h	2013-03-06 17:15:48.981692263 -0500
 @@ -38,6 +38,7 @@
  #include <parallel/random_number.h>
  #include <bits/stl_algo.h>

 
 	      bool __iam_finished = false;
 	      while (!__iam_finished)
@@ -177,6 +182,8 @@
 		      --__thread_right;
 		    }
 		}
+		tern_non_det_end();
+		tern_lineup(1);
 
 	      // Now swap the leftover chunks to the right places.
 	      if (__thread_left <= __thread_left_border)

 
 /** @brief Decide whether to declare certain variables volatile. */
 #define _GLIBCXX_VOLATILE volatile
@@ -87,6 +88,7 @@
 	    __num_threads = omp_get_num_threads();
 	    __reserved_left = new bool[__num_threads];
 	    __reserved_right = new bool[__num_threads];
+		tern_lineup_init(0, __num_threads, __num_threads*10000);
 
 	    if (__s.partition_chunk_share > 0.0)
 	      __chunk_size = std::max<_DifferenceType>
@@ -121,6 +123,8 @@
 	      __thread_left_border = __thread_left - 1;
 	      __thread_right = __n - 1;
 	      __thread_right_border = __thread_right + 1;
