Author: Armin Rigo <[email protected]>
Branch:
Changeset: r242:f689f7d2a0b4
Date: 2013-06-22 19:52 +0200
http://bitbucket.org/pypy/stmgc/changeset/f689f7d2a0b4/
Log: Fix
diff --git a/c4/et.c b/c4/et.c
--- a/c4/et.c
+++ b/c4/et.c
@@ -1501,8 +1501,8 @@
assert(descriptor_array_free_list >= 0);
assert(pd->stolen_objects.size == 0);
assert(pd->stolen_young_stubs.size == 0);
- assert(pd->collection_lock == 0 || pd->collection_lock == -1);
- pd->collection_lock = 0;
+ assert(pd->collection_lock == 0);
+ pd->shutdown = 0;
}
else {
/* no item in the free list */
diff --git a/c4/gcpage.c b/c4/gcpage.c
--- a/c4/gcpage.c
+++ b/c4/gcpage.c
@@ -549,7 +549,7 @@
revision_t index = -1;
while ((gcp = stm_get_free_public_descriptor(&index)) != NULL) {
- if (gcp->collection_lock == -1)
+ if (gcp->shutdown)
continue;
for (i = 1; i < GC_SMALL_REQUESTS; i++) {
@@ -557,7 +557,7 @@
sweep_pages(gcp, i, gpage);
}
assert(gcp->collection_lock == 0);
- gcp->collection_lock = -1;
+ gcp->shutdown = 1;
/* XXX ...stub_blocks... */
assert(gcp->stolen_objects.size == 0);
assert(gcp->stolen_young_stubs.size == 0);
diff --git a/c4/gcpage.h b/c4/gcpage.h
--- a/c4/gcpage.h
+++ b/c4/gcpage.h
@@ -60,7 +60,12 @@
gcptr free_loc_for_size[GC_SMALL_REQUESTS]; \
\
/* For statistics */ \
- size_t count_pages;
+ size_t count_pages; \
+ \
+ /* Set to 1 when a major collection shuts down a \
+ public_descriptor after the corresponding thread was \
+ already finished */ \
+ int shutdown;
#define LOCAL_GCPAGES() (thread_descriptor->public_descriptor)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit