On Sep 7, 2:04 pm, sturlamolden <sturlamol...@yahoo.no> wrote: > I just showed you how...
Modified the thread function to use these APIs, but the call to PyGILState_Ensure() is not returning at all. void *callPyFunction(void * arg) { // Method two to get function eval long thridx=(long)arg; printf("\n---->my num=%d, calling showstr pyfunction\n",thridx); char callpyf[] = "showstr(100)\n"; PyGILState_STATE state = PyGILState_Ensure(); printf("after PyGILState_Ensure\n"); PyObject* pycall = PyRun_String(callpyf,Py_file_input,glb, loc); if(pycall == NULL || PyErr_Occurred()){ printf("PyRun_String failed\n"); PyErr_Print(); } else printf("%d thread called showstr pyfunction ok\n",thridx); PyGILState_Release(state); pthread_exit(NULL); } -- http://mail.python.org/mailman/listinfo/python-list