Author: Armin Rigo <[email protected]>
Branch:
Changeset: r1096:4d330c8e6b92
Date: 2014-03-25 14:17 +0100
http://bitbucket.org/pypy/stmgc/changeset/4d330c8e6b92/
Log: Move this error-detection logic into
abort_data_structures_from_segment_num()
diff --git a/c7/stm/core.c b/c7/stm/core.c
--- a/c7/stm/core.c
+++ b/c7/stm/core.c
@@ -580,6 +580,16 @@
*/
struct stm_priv_segment_info_s *pseg = get_priv_segment(segment_num);
+ switch (pseg->transaction_state) {
+ case TS_REGULAR:
+ break;
+ case TS_INEVITABLE:
+ stm_fatalerror("abort: transaction_state == TS_INEVITABLE");
+ default:
+ stm_fatalerror("abort: bad transaction_state == %d",
+ (int)pseg->transaction_state);
+ }
+
/* throw away the content of the nursery */
long bytes_in_nursery = throw_away_nursery(pseg);
@@ -605,15 +615,6 @@
assert(_has_mutex());
dprintf(("~~~ ABORT\n"));
- switch (STM_PSEGMENT->transaction_state) {
- case TS_REGULAR:
- break;
- case TS_INEVITABLE:
- stm_fatalerror("abort: transaction_state == TS_INEVITABLE");
- default:
- stm_fatalerror("abort: bad transaction_state == %d",
- (int)STM_PSEGMENT->transaction_state);
- }
assert(STM_PSEGMENT->running_pthread == pthread_self());
abort_data_structures_from_segment_num(STM_SEGMENT->segment_num);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit