Commit 59831f72 authored by Stefan Behnel's avatar Stefan Behnel

added C++ vector test that operates in nogil mode

parent e2e92024
...@@ -109,3 +109,19 @@ def reverse_iteration_test(L): ...@@ -109,3 +109,19 @@ def reverse_iteration_test(L):
print(a) print(a)
finally: finally:
del v del v
def nogil_test(L):
"""
>>> nogil_test([1,2,3])
3
"""
cdef int a
with nogil:
v = new vector[int]()
try:
for a in L:
with nogil:
v.push_back(a)
return v.size()
finally:
del v
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment