Commits

Anonymous committed 7010c32 Draft

missed a synchronization point in insert

Comments (0)

Files changed (1)

 
     sync_pyamt_image();
     new_root = marshal_fn(amt_insert(current_amt, unmarshal_fn(old_root), key, keylen, v));
+    sync_pyamt_image();
+
     if (__sync_bool_compare_and_swap(amt_root_ref(current_amt), old_root, new_root)) {
       /* great success */
       Py_RETURN_NONE;
     return 0;
   }
 
-  /* the same logic used for writing new keys must be used for removing them */
-  
 
-  Py_RETURN_NONE;
+  amtnode *old_root, *new_root;
+  int attempts = 0;
+  const int maximum_attempts = 100;
+
+  while (attempts < maximum_attempts) {
+
+
+    ++attempts;
+  }
+
+  /* give up */
+  PyErr_SetString(Error, "too many deletion attempts failed");
+  return 0;
 }