[pypy-commit] stmgc c8-gil-like: Kill 'self' again, found a better way anyway

arigo noreply at buildbot.pypy.org
Sat Jun 13 18:18:35 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: c8-gil-like
Changeset: r1822:a8a04abfa22e
Date: 2015-06-13 18:19 +0200
http://bitbucket.org/pypy/stmgc/changeset/a8a04abfa22e/

Log:	Kill 'self' again, found a better way anyway

diff --git a/c8/stm/setup.c b/c8/stm/setup.c
--- a/c8/stm/setup.c
+++ b/c8/stm/setup.c
@@ -233,8 +233,6 @@
 {
     int num;
     s_mutex_lock();
-    tl->self = tl;    /* for faster access to &stm_thread_local (and easier
-                         from the PyPy JIT, too) */
     if (stm_all_thread_locals == NULL) {
         stm_all_thread_locals = tl->next = tl->prev = tl;
         num = 0;
diff --git a/c8/stmgc.h b/c8/stmgc.h
--- a/c8/stmgc.h
+++ b/c8/stmgc.h
@@ -71,7 +71,7 @@
     /* the next fields are handled internally by the library */
     int last_associated_segment_num;   /* always a valid seg num */
     int thread_local_counter;
-    struct stm_thread_local_s *self, *prev, *next;
+    struct stm_thread_local_s *prev, *next;
     void *creating_pthread[2];
 } stm_thread_local_t;
 
@@ -87,10 +87,10 @@
 long _stm_start_transaction(stm_thread_local_t *tl);
 void _stm_commit_transaction(void);
 void _stm_leave_noninevitable_transactional_zone(void);
-#define _stm_detach_inevitable_transaction(tl)  do {                    \
-    write_fence();                                                      \
-    assert(_stm_detached_inevitable_from_thread == 0);                  \
-    _stm_detached_inevitable_from_thread = (intptr_t)(tl->self);        \
+#define _stm_detach_inevitable_transaction(tl)  do {            \
+    write_fence();                                              \
+    assert(_stm_detached_inevitable_from_thread == 0);          \
+    _stm_detached_inevitable_from_thread = (intptr_t)(tl);      \
 } while (0)
 void _stm_reattach_transaction(stm_thread_local_t *tl);
 void _stm_become_inevitable(const char*);


More information about the pypy-commit mailing list