Skip to content

Commit 67683da

Browse files
authored
gh-160873: Remove obsolete pthread_getattr_np workaround (#160902)
Removes a workaround that was needed for older versions of Emscripten, but is no longer required. Also adapts to new command line arguments for enabling threading.
1 parent 3d81c05 commit 67683da

4 files changed

Lines changed: 8 additions & 72 deletions

File tree

‎Platforms/emscripten/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ await createEmscriptenModule({
138138

139139
- Threading is disabled by default. The ``configure`` option
140140
``--enable-wasm-pthreads`` adds compiler flag ``-pthread`` and
141-
linker flags ``-sUSE_PTHREADS -sPROXY_TO_PTHREAD``.
141+
linker flags ``-pthread -sPROXY_TO_PTHREAD``.
142142
- pthread support requires WASM threads and SharedArrayBuffer (bulk memory).
143143
The Node.JS runtime keeps a pool of web workers around. Each web worker
144144
uses several file descriptors (eventfd, epoll, pipe).

‎Python/ceval.c‎

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -70,70 +70,6 @@ _Py_ReachedRecursionLimitWithMargin(PyThreadState *tstate, int margin_count)
7070
# define Py_C_STACK_SIZE 4000000
7171
#endif
7272

73-
#if defined(__EMSCRIPTEN__)
74-
75-
// Temporary workaround to make `pthread_getattr_np` work on Emscripten.
76-
// Emscripten 4.0.6 will contain a fix:
77-
// https://github.com/emscripten-core/emscripten/pull/23887
78-
79-
#include "emscripten/stack.h"
80-
81-
#define pthread_attr_t workaround_pthread_attr_t
82-
#define pthread_attr_init workaround_pthread_attr_init
83-
#define pthread_getattr_np workaround_pthread_getattr_np
84-
#define pthread_attr_getguardsize workaround_pthread_attr_getguardsize
85-
#define pthread_attr_getstack workaround_pthread_attr_getstack
86-
#define pthread_attr_destroy workaround_pthread_attr_destroy
87-
88-
typedef struct {
89-
void *_a_stackaddr;
90-
size_t _a_stacksize, _a_guardsize;
91-
} pthread_attr_t;
92-
93-
extern __attribute__((__visibility__("hidden"))) unsigned __default_guardsize;
94-
95