From dcb7ee06e89d15ef2a79212ec7e2c569398663b0 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 19 Jul 2008 11:06:41 +0200 Subject: [PATCH] test for nogil functions --- tests/run/nogil.pyx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/run/nogil.pyx 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 -- 2.26.2