Changeset 388 for python/vendor/current/Include/ceval.h
- Timestamp:
- Mar 19, 2014, 11:11:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/vendor/current/Include/ceval.h
r2 r388 9 9 10 10 PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords( 11 PyObject *, PyObject *, PyObject *); 12 13 /* DLL-level Backwards compatibility: */ 14 #undef PyEval_CallObject 15 PyAPI_FUNC(PyObject *) PyEval_CallObject(PyObject *, PyObject *); 11 PyObject *, PyObject *, PyObject *); 16 12 17 13 /* Inline this */ 18 14 #define PyEval_CallObject(func,arg) \ 19 15 PyEval_CallObjectWithKeywords(func, arg, (PyObject *)NULL) 20 16 21 17 PyAPI_FUNC(PyObject *) PyEval_CallFunction(PyObject *obj, … … 51 47 52 48 #define Py_EnterRecursiveCall(where) \ 53 54 55 #define Py_LeaveRecursiveCall() 56 49 (_Py_MakeRecCheck(PyThreadState_GET()->recursion_depth) && \ 50 _Py_CheckRecursiveCall(where)) 51 #define Py_LeaveRecursiveCall() \ 52 (--PyThreadState_GET()->recursion_depth) 57 53 PyAPI_FUNC(int) _Py_CheckRecursiveCall(char *where); 58 54 PyAPI_DATA(int) _Py_CheckRecursionLimit; … … 80 76 threads to run as follows: 81 77 82 83 84 85 86 78 ...preparations here... 79 Py_BEGIN_ALLOW_THREADS 80 ...blocking system call here... 81 Py_END_ALLOW_THREADS 82 ...interpret result here... 87 83 88 84 The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a … … 91 87 a line containing Py_BLOCK_THREADS before the return, e.g. 92 88 93 94 95 96 97 89 if (...premature_exit...) { 90 Py_BLOCK_THREADS 91 PyErr_SetFromErrno(PyExc_IOError); 92 return NULL; 93 } 98 94 99 95 An alternative is: 100 96 101 102 103 104 105 106 97 Py_BLOCK_THREADS 98 if (...premature_exit...) { 99 PyErr_SetFromErrno(PyExc_IOError); 100 return NULL; 101 } 102 Py_UNBLOCK_THREADS 107 103 108 104 For convenience, that the value of 'errno' is restored across … … 133 129 134 130 #define Py_BEGIN_ALLOW_THREADS { \ 135 136 137 #define Py_BLOCK_THREADS 138 #define Py_UNBLOCK_THREADS 139 #define Py_END_ALLOW_THREADS 140 131 PyThreadState *_save; \ 132 _save = PyEval_SaveThread(); 133 #define Py_BLOCK_THREADS PyEval_RestoreThread(_save); 134 #define Py_UNBLOCK_THREADS _save = PyEval_SaveThread(); 135 #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \ 136 } 141 137 142 138 #else /* !WITH_THREAD */
Note:
See TracChangeset
for help on using the changeset viewer.