---- gcc-4.5.4-orig/libstdc++-v3/include/parallel/partition.h	2012-12-26 01:03:55.995889274 -0500
-+++ gcc-4.5.4/libstdc++-v3/include/parallel/partition.h	2013-03-16 16:48:42.606325029 -0400
+--- 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-08-18 23:28:11.396553337 -0400
 @@ -38,6 +38,7 @@
  #include <parallel/random_number.h>
  #include <bits/stl_algo.h>

 
 	      // Now swap the leftover chunks to the right places.
 	      if (__thread_left <= __thread_left_border)
@@ -313,7 +323,9 @@
 	delete[] __reserved_left;
 	delete[] __reserved_right;
 
+    pcs_enter();
 	omp_destroy_lock(&__result_lock);
+    pcs_exit();

 
 /** @brief Decide whether to declare certain variables volatile. */
 #define _GLIBCXX_VOLATILE volatile
@@ -76,7 +77,11 @@
       _DifferenceType __chunk_size = __s.partition_chunk_size;
 
       omp_lock_t __result_lock;
+      soba_init(0, __num_threads, __num_threads*20);
+      soba_init(1, __num_threads, __num_threads*20);
+      pcs_enter();
       omp_init_lock(&__result_lock);
+      pcs_exit();
 
       //at least two chunks per thread
       if (__right - __left + 1 >= 2 * __num_threads * __chunk_size)
@@ -121,6 +126,8 @@
 	      __thread_left_border = __thread_left - 1;
 	      __thread_right = __n - 1;
