mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Release GIL in index_of()
This commit is contained in:
parent
0d4c179c4b
commit
b12b830839
@ -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…
x
Reference in New Issue
Block a user