Release GIL in index_of()

This commit is contained in:
Kovid Goyal 2014-04-13 13:51:21 +05:30
parent 0d4c179c4b
commit b12b830839

View File

@ -642,6 +642,7 @@ icu_BreakIterator_index(icu_BreakIterator *self, PyObject *args, PyObject *kwarg
if (buf == NULL) return NULL; if (buf == NULL) return NULL;
if (sz < 1) goto end; if (sz < 1) goto end;
Py_BEGIN_ALLOW_THREADS;
p = ubrk_first(self->break_iterator); p = ubrk_first(self->break_iterator);
while (p != UBRK_DONE) { while (p != UBRK_DONE) {
prev = p; p = ubrk_next(self->break_iterator); prev = p; p = ubrk_next(self->break_iterator);
@ -657,6 +658,7 @@ icu_BreakIterator_index(icu_BreakIterator *self, PyObject *args, PyObject *kwarg
break; break;
} }
} }
Py_END_ALLOW_THREADS;
end: end:
free(buf); free(buf);