mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-03 01:33:11 +02:00
Release GIL in index_of()
This commit is contained in:
parent
0d4c179c4b
commit
b12b830839
1 changed files with 2 additions and 0 deletions
|
|
@ -642,6 +642,7 @@ icu_BreakIterator_index(icu_BreakIterator *self, PyObject *args, PyObject *kwarg
|
|||
if (buf == NULL) return NULL;
|
||||
if (sz < 1) goto end;
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS;
|
||||
p = ubrk_first(self->break_iterator);
|
||||
while (p != UBRK_DONE) {
|
||||
prev = p; p = ubrk_next(self->break_iterator);
|
||||
|
|
@ -657,6 +658,7 @@ icu_BreakIterator_index(icu_BreakIterator *self, PyObject *args, PyObject *kwarg
|
|||
break;
|
||||
}
|
||||
}
|
||||
Py_END_ALLOW_THREADS;
|
||||
|
||||
end:
|
||||
free(buf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue