Author: Conrad Calmez <con...@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() +@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() + +@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 _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit