[pypy-commit] pypy stmgc-c7: Kill special lock support for now

arigo noreply at buildbot.pypy.org
Wed Nov 12 12:36:24 CET 2014


Author: Armin Rigo <arigo at tunes.org>
Branch: stmgc-c7
Changeset: r74478:b19fcc6ab1a2
Date: 2014-11-12 12:17 +0100
http://bitbucket.org/pypy/pypy/changeset/b19fcc6ab1a2/

Log:	Kill special lock support for now

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -714,11 +714,7 @@
         if not we_are_translated() and self.config.translating:
             raise CannotHaveLock()
         try:
-            if self.config.translation.stm:
-                from pypy.module.thread import stm
-                return stm.allocate_stm_lock(self)
-            else:
-                return rthread.allocate_lock()
+            return rthread.allocate_lock()
         except rthread.error:
             raise OperationError(self.w_RuntimeError,
                                  self.wrap("out of resources"))
diff --git a/pypy/module/_stm/lock.py b/pypy/module/_stm/lock.py
deleted file mode 100644
--- a/pypy/module/_stm/lock.py
+++ /dev/null
@@ -1,21 +0,0 @@
-from pypy.module.thread.error import wrap_thread_error
-
-
-class STMLock(rthread.Lock):
-    def __init__(self, space, ll_lock):
-        rthread.Lock.__init__(self, ll_lock)
-        self.space = space
-
-    def acquire(self, flag):
-        if rstm.is_atomic():
-            acquired = rthread.Lock.acquire(self, False)
-            if flag and not acquired:
-                raise wrap_thread_error(self.space,
-                    "deadlock: an atomic transaction tries to acquire "
-                    "a lock that is already acquired.  See pypy/doc/stm.rst.")
-        else:
-            acquired = rthread.Lock.acquire(self, flag)
-        return acquired
-
-def allocate_stm_lock(space):
-    return STMLock(space, rthread.allocate_ll_lock())


More information about the pypy-commit mailing list