This commit is contained in:
Vitor Santos Costa
2018-03-14 00:41:05 +00:00
parent 1a8c26b886
commit c33a0d72db
15 changed files with 264 additions and 298 deletions

View File

@@ -643,16 +643,18 @@ static PyGILState_STATE gstate;
// if (_locked > 0) { _locked++ ; }
// else
gstate = PyGILState_Ensure();
fprintf(stderr, "+%d\n", (int)gstate);
PL_put_integer(curSlot, gstate);
pyErrorAndReturn(curSlot, false);
}
bool python_release_GIL(term_t curBlock) {
PyGILState_STATE gstate;
PyErr_Clear();
if (_threaded) {
PL_get_integer(curBlock, &gstate);
PyGILState_Release(gstate);
fprintf(stderr, "-%d\n", (int)gstate);
}
PL_reset_term_refs(curBlock);
pyErrorAndReturn(true, false);