Bläddra i källkod

Add more debugging messages to linearizability.

Jing Yang 4 år sedan
förälder
incheckning
0c4beaf0f0
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4 1
      linearizability/src/lib.rs

+ 4 - 1
linearizability/src/lib.rs

@@ -142,7 +142,10 @@ where
     <T as Model>::Output: Sync,
 {
     let mut results = vec![];
+    let mut partitions = vec![];
     for sub_history in T::partition(history) {
+        // Making a copy and pass the original value to the thread below.
+        partitions.push(sub_history.clone());
         results
             .push(std::thread::spawn(move || check_history::<T>(&sub_history)));
     }
@@ -150,7 +153,7 @@ where
     for (index, result) in results.into_iter().enumerate() {
         let result = result.join().expect("Search thread should never panic");
         if !result {
-            eprintln!("Partition {} failed.", index);
+            eprintln!("Partition {} failed: {:?}.", index, partitions[index]);
             failed.push(index);
         }
     }