[issue9900] Threading Bug or misuse of the api ?
New submission from Rob Watson : Is the below a bug or a misuse of the api ? This was compiled with visual studio 2008 and python26 64bit void testfunction() { for (int x = 1;x <= 10;x++) { PyGILState_STATE gstate = PyGILState_Ensure(); PyRun_SimpleString("2 + 1"); PyGILState_Release(gstate); } } int main() { Py_Initialize(); PyEval_InitThreads(); PyEval_ReleaseLock(); boost::thread(boost::bind(testfunction)); // if this Sleep(100) is commented out, I will get "Python Fatal Error : This thread state must be current when releasing" Sleep(100); testfunction(); Sleep(100); } -- components: None messages: 116891 nosy: Rob.Watson priority: normal severity: normal status: open title: Threading Bug or misuse of the api ? type: crash versions: Python 2.6 ___ Python tracker <http://bugs.python.org/issue9900> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9900] Threading Bug or misuse of the api ?
Changes by Rob Watson : -- resolution: -> invalid status: open -> closed ___ Python tracker <http://bugs.python.org/issue9900> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9900] Threading Bug or misuse of the api ?
Changes by Rob Watson : -- resolution: invalid -> ___ Python tracker <http://bugs.python.org/issue9900> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9900] Threading Bug or misuse of the api ?
Changes by Rob Watson : -- status: closed -> open ___ Python tracker <http://bugs.python.org/issue9900> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9900] Threading Bug or misuse of the api ?
Changes by Rob Watson : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue9900> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9900] Threading Bug or misuse of the api ?
Rob Watson added the comment: it seemed changing PyEval_ReleaseLock() to PyThreadState_DeleteCurrent() has fixed my problem. Thanks -- resolution: invalid -> ___ Python tracker <http://bugs.python.org/issue9900> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com