[pypy-commit] pypy stm-gc-2: Better fix

arigo noreply at buildbot.pypy.org
Sun Apr 7 17:00:05 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: stm-gc-2
Changeset: r63117:4f86a6afbcdb
Date: 2013-04-07 16:59 +0200
http://bitbucket.org/pypy/pypy/changeset/4f86a6afbcdb/

Log:	Better fix

diff --git a/rpython/translator/stm/src_stm/et.c b/rpython/translator/stm/src_stm/et.c
--- a/rpython/translator/stm/src_stm/et.c
+++ b/rpython/translator/stm/src_stm/et.c
@@ -499,7 +499,7 @@
   assert(d->list_of_read_objects.size == 0);
   assert(d->gcroots.size == 0);
   assert(!g2l_any_entry(&d->global_to_local));
-  d->count_reads = 0;
+  d->count_reads = 1;
   fxcache_clear(&d->recent_reads_cache);
   gcptrlist_clear(&d->undolog);
   gcptrlist_clear(&d->abortinfo);
diff --git a/rpython/translator/stm/src_stm/rpyintf.c b/rpython/translator/stm/src_stm/rpyintf.c
--- a/rpython/translator/stm/src_stm/rpyintf.c
+++ b/rpython/translator/stm/src_stm/rpyintf.c
@@ -84,7 +84,8 @@
   /* a single comparison to handle all cases:
 
      - if d->atomic, then we should return False.  This is done by
-       forcing reads_size_limit to ULONG_MAX as soon as atomic > 0.
+       forcing reads_size_limit to ULONG_MAX as soon as atomic > 0,
+       and no possible value of 'count_reads' is greater than ULONG_MAX.
 
      - otherwise, if is_inevitable(), then we should return True.
        This is done by forcing both reads_size_limit and
@@ -105,7 +106,7 @@
     assert(d->reads_size_limit_nonatomic == 0);
 #endif
 
-  return d->count_reads >= d->reads_size_limit;
+  return d->count_reads > d->reads_size_limit;
 }
 
 void stm_set_transaction_length(long length_max)


More information about the pypy-commit mailing list