[pypy-commit] lang-smalltalk stmgc-c7: implemented STM atomic primitives

Conrad Calmez noreply at buildbot.pypy.org
Thu May 22 16:13:55 CEST 2014


Author: Conrad Calmez <conrad at calmez.net>
Branch: stmgc-c7
Changeset: r839:981f12dee8ca
Date: 2014-05-22 16:10 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/981f12dee8ca/

Log:	implemented STM atomic primitives

diff --git a/spyvm/primitives.py b/spyvm/primitives.py
--- a/spyvm/primitives.py
+++ b/spyvm/primitives.py
@@ -1489,6 +1489,22 @@
     print "STM Rendezvous"
     print "Should break: %s" % rstm.should_break_transaction()
 
+ at expose_primitive(STM_ATOMIC_ENTER, unwrap_spec=[object], no_result=True)
+def func(interp, s_frame, w_rcvr):
+    from rpython.rlib import rstm
+
+    print "STM_ATOMIC_ENTER primitive called"
+
+    rstm.increment_atomic()
+
+ at expose_primitive(STM_ATOMIC_LEAVE, unwrap_spec=[object], no_result=True)
+def func(interp, s_frame, w_rcvr):
+    from rpython.rlib import rstm
+
+    print "STM_ATOMIC_LEAVE primitive called"
+
+    rstm.decrement_atomic()
+
 # ___________________________________________________________________________
 # BlockClosure Primitives
 


More information about the pypy-commit mailing list