projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f10294d
)
test for nogil functions
author
Stefan Behnel
<scoder@users.berlios.de>
Sat, 19 Jul 2008 09:06:41 +0000
(11:06 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sat, 19 Jul 2008 09:06:41 +0000
(11:06 +0200)
tests/run/nogil.pyx
[new file with mode: 0644]
patch
|
blob
diff --git a/tests/run/nogil.pyx
b/tests/run/nogil.pyx
new file mode 100644
(file)
index 0000000..
2671b9a
--- /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