Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-111569: Fix critical sections test on WebAssembly#111897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brettcannon merged 3 commits intopython:mainfromcolesbury:critical_sections-wasm
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Go back to Py_CAN_START_THREADS
  • Loading branch information
@colesbury
colesbury committedNov 9, 2023
commit2ac2321dda2f51f7bc00ffa3a51e6dda51a5e368
8 changes: 8 additions & 0 deletionsInclude/pyport.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -470,6 +470,14 @@ extern "C" {
# define WITH_THREAD
#endif

/* Some WebAssembly platforms do not provide a working pthread implementation.
* Thread support is stubbed and any attempt to create a new thread fails.
*/
#if (!defined(HAVE_PTHREAD_STUBS) && \
(!defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__)))
# define Py_CAN_START_THREADS 1
#endif

#ifdef WITH_THREAD
# ifdef Py_BUILD_CORE
# ifdef HAVE_THREAD_LOCAL
Expand Down
4 changes: 2 additions & 2 deletionsModules/_testinternalcapi/test_critical_sections.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -170,7 +170,7 @@ thread_critical_sections(void *arg)
}
}

#ifndef HAVE_PTHREAD_STUBS
#ifdef Py_CAN_START_THREADS
static PyObject *
test_critical_sections_threads(PyObject *self, PyObject *Py_UNUSED(args))
{
Expand DownExpand Up@@ -201,7 +201,7 @@ static PyMethodDef test_methods[] = {
{"test_critical_sections", test_critical_sections, METH_NOARGS},
{"test_critical_sections_nest", test_critical_sections_nest, METH_NOARGS},
{"test_critical_sections_suspend", test_critical_sections_suspend, METH_NOARGS},
#ifndef HAVE_PTHREAD_STUBS
#ifdef Py_CAN_START_THREADS
{"test_critical_sections_threads", test_critical_sections_threads, METH_NOARGS},
#endif
{NULL, NULL} /* sentinel */
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp