Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 28720:03af46d1ac28 legacy-trunk
PyGILState cleanup was too early - destructors called via module cleanup may use the API.
| author | Mark Hammond <mhammond@skippinet.com.au> |
|---|---|
| date | Tue, 22 Apr 2003 11:18:00 +0000 |
| parents | aef01a076ef9 |
| children | 72cbc41ccc2f |
comparison
equal
deleted
inserted
replaced
| 28719:5e6ffa655462 | 28720:03af46d1ac28 |
|---|---|
| 252 * the threads created via Threading. | 252 * the threads created via Threading. |
| 253 */ | 253 */ |
| 254 call_sys_exitfunc(); | 254 call_sys_exitfunc(); |
| 255 initialized = 0; | 255 initialized = 0; |
| 256 | 256 |
| 257 /* Cleanup auto-thread-state */ | |
| 258 #ifdef WITH_THREAD | |
| 259 _PyGILState_Fini(); | |
| 260 #endif /* WITH_THREAD */ | |
| 261 | |
| 262 /* Get current thread state and interpreter pointer */ | 257 /* Get current thread state and interpreter pointer */ |
| 263 tstate = PyThreadState_Get(); | 258 tstate = PyThreadState_Get(); |
| 264 interp = tstate->interp; | 259 interp = tstate->interp; |
| 265 | 260 |
| 266 /* Disable signal handling */ | 261 /* Disable signal handling */ |
| 307 can raise an exception. That's okay, because each Fini() method | 302 can raise an exception. That's okay, because each Fini() method |
| 308 below has been checked to make sure no exceptions are ever | 303 below has been checked to make sure no exceptions are ever |
| 309 raised. | 304 raised. |
| 310 */ | 305 */ |
| 311 _PyExc_Fini(); | 306 _PyExc_Fini(); |
| 307 | |
| 308 /* Cleanup auto-thread-state */ | |
| 309 #ifdef WITH_THREAD | |
| 310 _PyGILState_Fini(); | |
| 311 #endif /* WITH_THREAD */ | |
| 312 | 312 |
| 313 /* Clear interpreter state */ | 313 /* Clear interpreter state */ |
| 314 PyInterpreterState_Clear(interp); | 314 PyInterpreterState_Clear(interp); |
| 315 | 315 |
| 316 /* Delete current thread */ | 316 /* Delete current thread */ |
