Author: Remi Meier <meier...@student.ethz.ch>
Branch: 
Changeset: r200:0efe1499373f
Date: 2013-06-20 09:30 +0200
http://bitbucket.org/pypy/stmgc/changeset/0efe1499373f/

Log:    add more stm_normalize_stolen_objects where needed

diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -698,8 +698,12 @@
   long long elapsed_time;
 
   /* acquire the lock, but don't double-acquire it if already committing */
-  if (d->public_descriptor->collection_lock != 'C')
+  if (d->public_descriptor->collection_lock != 'C') {
     spinlock_acquire(d->public_descriptor->collection_lock, 'C');
+    if (d->public_descriptor->stolen_objects.size != 0)
+      stm_normalize_stolen_objects(d);
+  }
+
 
   assert(d->active != 0);
   assert(!is_inevitable(d));
@@ -870,6 +874,8 @@
   revision_t my_lock = d->my_lock;
   wlog_t *item;
 
+  assert(d->public_descriptor->stolen_objects.size == 0);
+
   if (!g2l_any_entry(&d->public_to_private))
     return;
 
@@ -1025,6 +1031,7 @@
   gcptr *items = d->private_from_protected.items;
   revision_t new_revision = cur_time + 1;     // make an odd number
   assert(new_revision & 1);
+  assert(d->public_descriptor->stolen_objects.size == 0);
 
   for (i = 0; i < size; i++)
     {
@@ -1125,7 +1132,6 @@
   spinlock_acquire(d->public_descriptor->collection_lock, 'C');  /*committing*/
   if (d->public_descriptor->stolen_objects.size != 0)
     stm_normalize_stolen_objects(d);
-
   AcquireLocks(d);
 
   if (is_inevitable(d))
@@ -1151,6 +1157,9 @@
               inev_mutex_acquire();   // wait until released
               inev_mutex_release();
               spinlock_acquire(d->public_descriptor->collection_lock, 'C');
+              if (d->public_descriptor->stolen_objects.size != 0)
+                stm_normalize_stolen_objects(d);
+
               AcquireLocks(d);
               continue;
             }
@@ -1162,6 +1171,7 @@
         if (!ValidateDuringTransaction(d, 1))
           AbortTransaction(ABRT_VALIDATE_COMMIT);
     }
+
   CommitPrivateFromProtected(d, cur_time);
 
   /* we cannot abort any more from here */
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to