LEFT | RIGHT |
1 | 1 |
2 /* Module definition and import implementation */ | 2 /* Module definition and import implementation */ |
3 | 3 |
4 #include "Python.h" | 4 #include "Python.h" |
5 | 5 |
6 #include "Python-ast.h" | 6 #include "Python-ast.h" |
7 #undef Yield /* undefine macro conflicting with winbase.h */ | 7 #undef Yield /* undefine macro conflicting with winbase.h */ |
8 #include "pyarena.h" | 8 #include "pyarena.h" |
9 #include "pythonrun.h" | 9 #include "pythonrun.h" |
10 #include "errcode.h" | 10 #include "errcode.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 } | 296 } |
297 return 1; | 297 return 1; |
298 } | 298 } |
299 | 299 |
300 /* This function is called from PyOS_AfterFork to ensure that newly | 300 /* This function is called from PyOS_AfterFork to ensure that newly |
301 created child processes do not share locks with the parent. */ | 301 created child processes do not share locks with the parent. */ |
302 | 302 |
303 void | 303 void |
304 _PyImport_ReInitLock(void) | 304 _PyImport_ReInitLock(void) |
305 { | 305 { |
| 306 #ifdef _AIX |
| 307 if (import_lock != NULL) |
| 308 import_lock = PyThread_allocate_lock(); |
| 309 #endif |
306 } | 310 } |
307 | 311 |
308 #endif | 312 #endif |
309 | 313 |
310 static PyObject * | 314 static PyObject * |
311 imp_lock_held(PyObject *self, PyObject *noargs) | 315 imp_lock_held(PyObject *self, PyObject *noargs) |
312 { | 316 { |
313 #ifdef WITH_THREAD | 317 #ifdef WITH_THREAD |
314 return PyBool_FromLong(import_lock_thread != -1); | 318 return PyBool_FromLong(import_lock_thread != -1); |
315 #else | 319 #else |
(...skipping 3062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3378 | 3382 |
3379 newtab[0].name = name; | 3383 newtab[0].name = name; |
3380 newtab[0].initfunc = initfunc; | 3384 newtab[0].initfunc = initfunc; |
3381 | 3385 |
3382 return PyImport_ExtendInittab(newtab); | 3386 return PyImport_ExtendInittab(newtab); |
3383 } | 3387 } |
3384 | 3388 |
3385 #ifdef __cplusplus | 3389 #ifdef __cplusplus |
3386 } | 3390 } |
3387 #endif | 3391 #endif |
LEFT | RIGHT |