Author: Armin Rigo <[email protected]>
Branch:
Changeset: r42:0fc12d746859
Date: 2013-05-27 16:13 +0200
http://bitbucket.org/pypy/stmgc/changeset/0fc12d746859/
Log: Fix
diff --git a/c3/et.c b/c3/et.c
--- a/c3/et.c
+++ b/c3/et.c
@@ -621,6 +621,7 @@
static void CancelLocks(struct tx_descriptor *d)
{
+ revision_t my_lock = d->my_lock;
wlog_t *item;
if (!g2l_any_entry(&d->public_to_private))
@@ -628,16 +629,20 @@
G2L_LOOP_FORWARD(d->public_to_private, item)
{
+ gcptr R = item->addr;
gcptr L = item->val;
revision_t v = L->h_revision;
if (v == stm_local_revision)
- break; /* done */
+ {
+ assert(R->h_revision != my_lock);
+ break; /* done */
+ }
L->h_revision = stm_local_revision;
- gcptr R = item->addr;
#ifdef DUMP_EXTRA
fprintf(stderr, "%p->h_revision = %p (CancelLocks)\n", R, (gcptr)v);
#endif
+ assert(R->h_revision == my_lock);
ACCESS_ONCE(R->h_revision) = v;
} G2L_LOOP_END;
diff --git a/c3/nursery.c b/c3/nursery.c
--- a/c3/nursery.c
+++ b/c3/nursery.c
@@ -108,7 +108,12 @@
void stmgc_done_tls(void)
{
struct tx_descriptor *d = thread_descriptor;
+
+ spinlock_acquire(d->collection_lock, 'F'); /* freeing */
+
assert(d->nursery_current == d->nursery); /* else, not empty! */
+ assert(!g2l_any_entry(&d->young_objects_outside_nursery));
+
stm_free(d->nursery, GC_NURSERY);
gcptrlist_delete(&d->protected_with_private_copy);
g2l_delete(&d->public_to_private);
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit