Author: Armin Rigo <[email protected]>
Branch: stmgc-c7
Changeset: r76026:670bf8f99260
Date: 2015-02-21 09:33 +0100
http://bitbucket.org/pypy/pypy/changeset/670bf8f99260/

Log:    Two tests. One fails and one passes

diff --git a/pypy/module/pypystm/test_pypy_c/test_no_conflict.py 
b/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
--- a/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
+++ b/pypy/module/pypystm/test_pypy_c/test_no_conflict.py
@@ -29,6 +29,27 @@
         #
         self.check_almost_no_conflict(f)
 
+    def test_stmdict_populate(self):
+        def f():
+            import pypystm, random
+            d = pypystm.stmdict()     # shared
+            def g(r):
+                value = r.randrange(0, 1000000000)
+                d[value] = None
+            run_in_threads(g, arg_class=random.Random)
+        #
+        self.check_almost_no_conflict(f)
+
+    def test_threadlocal(self):
+        def f():
+            import thread
+            tls = thread._local()
+            def g():
+                tls.value = getattr(tls, 'value', 0) + 1
+            run_in_threads(g)
+        #
+        self.check_almost_no_conflict(f)
+
     def test_weakrefs(self):
         py.test.skip("next issue")
         def f():
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to