Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe38ff9

Browse files
committed
Use HAVE_PTHREAD_STUBS instead
1 parent aef9180 commit fe38ff9

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Include/pyport.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,13 +470,6 @@ extern "C" {
470470
# define WITH_THREAD
471471
#endif
472472

473-
/* Some WebAssembly platforms do not provide a working pthread implementation.
474-
* Thread support is stubbed and any attempt to create a new thread fails.
475-
*/
476-
#if !defined(__wasi__) && (!defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__))
477-
# define Py_CAN_START_THREADS 1
478-
#endif
479-
480473
#ifdef WITH_THREAD
481474
# ifdef Py_BUILD_CORE
482475
# ifdef HAVE_THREAD_LOCAL

Modules/_testinternalcapi/test_critical_sections.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ thread_critical_sections(void *arg)
170170
}
171171
}
172172

173-
#ifdef Py_CAN_START_THREADS
173+
#ifndef HAVE_PTHREAD_STUBS
174174
static PyObject *
175175
test_critical_sections_threads(PyObject *self, PyObject *Py_UNUSED(args))
176176
{
@@ -201,7 +201,7 @@ static PyMethodDef test_methods[] = {
201201
{"test_critical_sections", test_critical_sections, METH_NOARGS},
202202
{"test_critical_sections_nest", test_critical_sections_nest, METH_NOARGS},
203203
{"test_critical_sections_suspend", test_critical_sections_suspend, METH_NOARGS},
204-
#ifdef Py_CAN_START_THREADS
204+
#ifndef HAVE_PTHREAD_STUBS
205205
{"test_critical_sections_threads", test_critical_sections_threads, METH_NOARGS},
206206
#endif
207207
{NULL, NULL} /* sentinel */

0 commit comments

Comments
 (0)