[pypy-commit] stmgc default: Fix the next issue

arigo noreply at buildbot.pypy.org
Wed Jun 12 21:22:44 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r102:5eaf6b65867f
Date: 2013-06-12 21:22 +0200
http://bitbucket.org/pypy/stmgc/changeset/5eaf6b65867f/

Log:	Fix the next issue

diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -511,7 +511,18 @@
       v = ACCESS_ONCE(R->h_revision);
       if (!(v & 1))               // "is a pointer", i.e.
         {                         //   "has a more recent revision"
-          return 0;
+          if (R->h_tid & GCFLAG_PRIVATE_FROM_PROTECTED)
+            {
+              /* such an object R might be listed in list_of_read_objects
+                 before it was turned from protected to private */
+              continue;
+            }
+          else
+            {
+              fprintf(stderr, "validation failed: "
+                      "%p has a more recent revision\n", R);
+              return 0;
+            }
         }
       if (v >= LOCKED)            // locked
         {
@@ -524,7 +535,11 @@
           else
             {
               if (v != d->my_lock)         // not locked by me: conflict
-                return 0;
+                {
+                  fprintf(stderr, "validation failed: "
+                          "%p is locked by another thread\n", R);
+                  return 0;
+                }
             }
         }
     }


More information about the pypy-commit mailing list