From: Stefan Behnel Date: Sat, 19 Jul 2008 09:06:41 +0000 (+0200) Subject: test for nogil functions X-Git-Tag: 0.9.8.1~118 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dcb7ee06e89d15ef2a79212ec7e2c569398663b0;p=cython.git test for nogil functions --- diff --git a/tests/run/nogil.pyx b/tests/run/nogil.pyx new file mode 100644 index 00000000..2671b9a1 --- /dev/null +++ b/tests/run/nogil.pyx @@ -0,0 +1,22 @@ +__doc__ = u""" +>>> test(5) +89 +>>> test(11) +95 +""" + +def test(int x): + with nogil: + f(x) + x = g(x) + return x + +cdef void f(int x) nogil: + cdef int y + y = x + 42 + g(y) + +cdef int g(int x) nogil: + cdef int y + y = x + 42 + return y