Author: Remi Meier <[email protected]>
Branch:
Changeset: r1206:3b302406acd8
Date: 2014-05-13 10:43 +0200
http://bitbucket.org/pypy/stmgc/changeset/3b302406acd8/
Log: signal inevitable transaction to commit if we are waiting for it
diff --git a/c7/stm/sync.c b/c7/stm/sync.c
--- a/c7/stm/sync.c
+++ b/c7/stm/sync.c
@@ -129,7 +129,8 @@
long i;
restart:
for (i = 1; i <= NB_SEGMENTS; i++) {
- if (get_priv_segment(i)->transaction_state == TS_INEVITABLE) {
+ struct stm_priv_segment_info_s *other_pseg = get_priv_segment(i);
+ if (other_pseg->transaction_state == TS_INEVITABLE) {
if (tl_or_null_if_can_abort == NULL) {
/* handle this case like a contention: it will either
abort us (not the other thread, which is inevitable),
@@ -141,6 +142,7 @@
else {
/* wait for stm_commit_transaction() to finish this
inevitable transaction */
+ signal_other_to_commit_soon(other_pseg);
change_timing_state_tl(tl_or_null_if_can_abort,
STM_TIME_WAIT_INEVITABLE);
cond_wait(C_INEVITABLE);
@@ -264,7 +266,7 @@
static bool _safe_points_requested = false;
#endif
-static void signal_other_to_commit_soon(struct stm_priv_segment_info_s
*other_pseg)
+void signal_other_to_commit_soon(struct stm_priv_segment_info_s *other_pseg)
{
assert(_has_mutex());
/* never overwrite abort signals or safepoint requests
diff --git a/c7/stm/sync.h b/c7/stm/sync.h
--- a/c7/stm/sync.h
+++ b/c7/stm/sync.h
@@ -38,3 +38,5 @@
static void committed_globally_unique_transaction(void);
static bool pause_signalled, globally_unique_transaction;
+
+void signal_other_to_commit_soon(struct stm_priv_segment_info_s *other_pseg);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit