Author: Armin Rigo <[email protected]>
Branch:
Changeset: r153:dc86e7cd8452
Date: 2013-06-16 18:15 +0200
http://bitbucket.org/pypy/stmgc/changeset/dc86e7cd8452/
Log: Next fix
diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -601,6 +601,13 @@
before it was turned from protected to private */
continue;
}
+ else if ((R->h_tid & (GCFLAG_PUBLIC | GCFLAG_NURSERY_MOVED))
+ == (GCFLAG_PUBLIC | GCFLAG_NURSERY_MOVED))
+ {
+ /* such an object is identical to the one it points to */
+ R = (gcptr)v;
+ goto retry;
+ }
else
{
fprintf(stderr, "validation failed: "
@@ -611,20 +618,15 @@
if (v >= LOCKED) // locked
{
if (!during_commit)
+ assert(v != d->my_lock); // we don't hold any lock
+
+ if (v != d->my_lock)
{
- assert(v != d->my_lock); // we don't hold any lock
+ /* not locked by me: spinloop until the other thread releases
+ its lock */
SpinLoop(SPLP_LOCKED_VALIDATE);
goto retry;
}
- else
- {
- if (v != d->my_lock) // not locked by me: conflict
- {
- fprintf(stderr, "validation failed: "
- "%p is locked by another thread\n", R);
- return 0;
- }
- }
}
}
return 1;
diff --git a/c4/nursery.c b/c4/nursery.c
--- a/c4/nursery.c
+++ b/c4/nursery.c
@@ -87,6 +87,7 @@
static inline gcptr create_old_object_copy(gcptr obj)
{
+ assert(!(obj->h_tid & GCFLAG_PUBLIC));
assert(!(obj->h_tid & GCFLAG_NURSERY_MOVED));
assert(!(obj->h_tid & GCFLAG_VISITED));
assert(!(obj->h_tid & GCFLAG_WRITE_BARRIER));
diff --git a/c4/test/test_random.py b/c4/test/test_random.py
--- a/c4/test/test_random.py
+++ b/c4/test/test_random.py
@@ -506,5 +506,5 @@
def test_more_multi_thread():
#py.test.skip("more random tests")
- for i in range(45, 100):
+ for i in range(46, 100):
yield test_multi_thread, 1200 + i
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit