Martin Blais
blais at furius.ca
Wed Jan 4 00:00:56 EST 2006
On 1/3/06, Graham Dumpleton <grahamd at dscpl.com.au> wrote: > /* XXX */ > PyThreadState *tstate; > PyObject *key, *value; > char *name; > int pos = 0; > > #ifdef WITH_THREAD > PyEval_AcquireLock(); > > while (PyDict_Next(interpreters, &pos, &key, &value)) { > name = PyString_AsString(key); > ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0, > "%d interpreter %s", getpid(), name); if (strcmp(name,MAIN_INTERPRETER) != 0) { > idata = (interpreterdata *)PyCObject_AsVoidPtr(value); > tstate = idata->istate->tstate_head; > PyThreadState_Swap(tstate); > ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0, > "%d end interpreter %s", getpid(), name); > Py_EndInterpreter(tstate); > PyThreadState_Swap(NULL); > ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0, > "%d done interpreter %s", getpid(), name); > } > else > { BTW, I think that right here you need to setup a thread-state and call Py_EndInterpreter for those other interpreters as well, no? > ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0, > "%d skip interpreter %s", getpid(), name); > } > } > > PyEval_ReleaseLock(); > > ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, 0, > "%d now do finalize", getpid()); > #endif > > /* XXX */ >
|