Detach the stdin write thread so that it is auto-cleaned up
This commit is contained in:
parent
95b9b2d373
commit
f151f4c165
@ -231,7 +231,6 @@ start(PyObject *s, PyObject *a UNUSED) {
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
wakeup(PYNOARG) {
|
wakeup(PYNOARG) {
|
||||||
#define wakeup_doc "wakeup() -> wakeup the ChildMonitor I/O thread, forcing it to exit from poll() if it is waiting there."
|
#define wakeup_doc "wakeup() -> wakeup the ChildMonitor I/O thread, forcing it to exit from poll() if it is waiting there."
|
||||||
@ -793,6 +792,7 @@ cm_thread_write(PyObject UNUSED *self, PyObject *args) {
|
|||||||
memcpy(data->buf, buf, data->sz);
|
memcpy(data->buf, buf, data->sz);
|
||||||
int ret = pthread_create(&thread, NULL, thread_write, data);
|
int ret = pthread_create(&thread, NULL, thread_write, data);
|
||||||
if (ret != 0) { free_twd(data); return PyErr_SetFromErrno(PyExc_OSError); }
|
if (ret != 0) { free_twd(data); return PyErr_SetFromErrno(PyExc_OSError); }
|
||||||
|
pthread_detach(thread);
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user