mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config * Always define WITH_THREAD for compatibility.
This commit is contained in:
parent
1f06a680de
commit
a6a4dc816d
135 changed files with 2472 additions and 4377 deletions
|
@ -680,9 +680,7 @@ _Py_fstat(int fd, struct _Py_stat_struct *status)
|
|||
{
|
||||
int res;
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
res = _Py_fstat_noraise(fd, status);
|
||||
|
@ -999,10 +997,8 @@ _Py_open_impl(const char *pathname, int flags, int gil_held)
|
|||
int
|
||||
_Py_open(const char *pathname, int flags)
|
||||
{
|
||||
#ifdef WITH_THREAD
|
||||
/* _Py_open() must be called with the GIL held. */
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
return _Py_open_impl(pathname, flags, 1);
|
||||
}
|
||||
|
||||
|
@ -1095,9 +1091,7 @@ _Py_fopen_obj(PyObject *path, const char *mode)
|
|||
wchar_t wmode[10];
|
||||
int usize;
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
|
||||
if (!PyUnicode_Check(path)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
|
@ -1125,9 +1119,7 @@ _Py_fopen_obj(PyObject *path, const char *mode)
|
|||
PyObject *bytes;
|
||||
char *path_bytes;
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
|
||||
if (!PyUnicode_FSConverter(path, &bytes))
|
||||
return NULL;
|
||||
|
@ -1177,9 +1169,7 @@ _Py_read(int fd, void *buf, size_t count)
|
|||
int err;
|
||||
int async_err = 0;
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
|
||||
/* _Py_read() must not be called with an exception set, otherwise the
|
||||
* caller may think that read() was interrupted by a signal and the signal
|
||||
|
@ -1318,9 +1308,7 @@ _Py_write_impl(int fd, const void *buf, size_t count, int gil_held)
|
|||
Py_ssize_t
|
||||
_Py_write(int fd, const void *buf, size_t count)
|
||||
{
|
||||
#ifdef WITH_THREAD
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
|
||||
/* _Py_write() must not be called with an exception set, otherwise the
|
||||
* caller may think that write() was interrupted by a signal and the signal
|
||||
|
@ -1471,9 +1459,7 @@ _Py_dup(int fd)
|
|||
DWORD ftype;
|
||||
#endif
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
assert(PyGILState_Check());
|
||||
#endif
|
||||
|
||||
#ifdef MS_WINDOWS
|
||||
_Py_BEGIN_SUPPRESS_IPH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue