[pypy-commit] pypy nogil-unsafe-2: Rename the operation to reflect the readonly-ness

arigo pypy.commits at gmail.com
Sat Sep 2 05:34:06 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: nogil-unsafe-2
Changeset: r92305:4698de95c523
Date: 2017-09-02 11:33 +0200
http://bitbucket.org/pypy/pypy/changeset/4698de95c523/

Log:	Rename the operation to reflect the readonly-ness

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -433,7 +433,7 @@
 
         def _trace_tlref(gc, obj, callback, arg):
             p = llmemory.NULL
-            llop.threadlocalref_acquire(lltype.Void)
+            llop.threadlocalref_readonly_acquire(lltype.Void)
             while True:
                 p = llop.threadlocalref_enum(llmemory.Address, p)
                 if not p:
@@ -490,7 +490,7 @@
 @specialize.arg(0)
 def enum_all_threadlocals(callback, arg):
     p = llmemory.NULL
-    llop.threadlocalref_acquire(lltype.Void)
+    llop.threadlocalref_readonly_acquire(lltype.Void)
     while True:
         p = llop.threadlocalref_enum(llmemory.Address, p)
         if not p:
diff --git a/rpython/rtyper/llinterp.py b/rpython/rtyper/llinterp.py
--- a/rpython/rtyper/llinterp.py
+++ b/rpython/rtyper/llinterp.py
@@ -997,7 +997,7 @@
         return self.op_raw_load(RESTYPE, _address_of_thread_local(), offset)
     op_threadlocalref_get.need_result_type = True
 
-    def op_threadlocalref_acquire(self, prev):
+    def op_threadlocalref_readonly_acquire(self, prev):
         raise NotImplementedError
     def op_threadlocalref_release(self, prev):
         raise NotImplementedError
diff --git a/rpython/rtyper/lltypesystem/lloperation.py b/rpython/rtyper/lltypesystem/lloperation.py
--- a/rpython/rtyper/lltypesystem/lloperation.py
+++ b/rpython/rtyper/lltypesystem/lloperation.py
@@ -551,8 +551,8 @@
 
     'threadlocalref_addr':  LLOp(),                   # get (or make) addr of tl
     'threadlocalref_get':   LLOp(sideeffects=False),  # read field (no check)
-    'threadlocalref_acquire':  LLOp(),                # lock for enum
-    'threadlocalref_release':  LLOp(),                # lock for enum
+    'threadlocalref_readonly_acquire':  LLOp(),       # lock for enum
+    'threadlocalref_release':           LLOp(),       # lock for enum
     'threadlocalref_enum':  LLOp(sideeffects=False),  # enum all threadlocalrefs
 
     # __________ debugging __________
diff --git a/rpython/translator/c/src/thread_gil.c b/rpython/translator/c/src/thread_gil.c
--- a/rpython/translator/c/src/thread_gil.c
+++ b/rpython/translator/c/src/thread_gil.c
@@ -111,7 +111,7 @@
     assert(counter_of_sevens == 0);
 
     /* signal all threads to enter safepoints */
-    OP_THREADLOCALREF_ACQUIRE(/* */);
+    OP_THREADLOCALREF_READONLY_ACQUIRE(/* */);
 
     struct pypy_threadlocal_s *t = NULL;
     while (1) {
diff --git a/rpython/translator/c/src/threadlocal.h b/rpython/translator/c/src/threadlocal.h
--- a/rpython/translator/c/src/threadlocal.h
+++ b/rpython/translator/c/src/threadlocal.h
@@ -31,7 +31,8 @@
 /* will return the head of the list */
 RPY_EXTERN struct pypy_threadlocal_s *_RPython_ThreadLocals_Head();
 
-#define OP_THREADLOCALREF_ACQUIRE(r)   _RPython_ThreadLocals_ReadOnlyAcquire()
+#define OP_THREADLOCALREF_READONLY_ACQUIRE(r)     \
+                                       _RPython_ThreadLocals_ReadOnlyAcquire()
 #define OP_THREADLOCALREF_RELEASE(r)   _RPython_ThreadLocals_Release()
 #define OP_THREADLOCALREF_ENUM(p, r)   r = _RPython_ThreadLocals_Enum(p)
 


More information about the pypy-commit mailing list