Skip to content

Commit 946ab57

Browse files
authored
Prefer mutex typedefs provided by musl (#24842)
Followup to #24773.
1 parent fa24df9 commit 946ab57

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

system/lib/libc/musl/arch/emscripten/bits/alltypes.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,6 @@ typedef struct { union { int __i[10]; volatile int __vi[10]; unsigned long __s[1
9393
#endif
9494

9595

96-
// TODO(kleisauke): Remove these two typedefs.
97-
#if defined(__NEED_pthread_mutex_t) && !defined(__DEFINED_pthread_mutex_t)
98-
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } pthread_mutex_t;
99-
#define __DEFINED_pthread_mutex_t
100-
#endif
101-
102-
#if defined(__NEED_mtx_t) && !defined(__DEFINED_mtx_t)
103-
typedef struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } mtx_t;
104-
#define __DEFINED_mtx_t
105-
#endif
106-
107-
10896
// END EMSCRIPTEN-SPECIFIC DEFINITIONS
10997
//
11098
// Below here are the shared musl definitions. The emscripten-specific definitions above will take precedence

system/lib/libc/musl/arch/emscripten/bits/alltypes.h.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ TYPEDEF struct { alignas(8) long long __ll; long double __ld; } max_align_t;
3737
// to pass a pointer to a string denoting the WebGL canvases to transfer.
3838
TYPEDEF struct { union { int __i[10]; volatile int __vi[10]; unsigned long __s[10]; } __u; const char *_a_transferredcanvases; } pthread_attr_t;
3939

40-
// TODO(kleisauke): Remove these two typedefs.
41-
TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } pthread_mutex_t;
42-
TYPEDEF struct { union { int __i[6]; volatile int __vi[6]; volatile void * /*volatile*/__p[6]; } __u; } mtx_t;
43-
4440
// END EMSCRIPTEN-SPECIFIC DEFINITIONS
4541
//
4642
// Below here are the shared musl definitions. The emscripten-specific definitions above will take precedence

test/code_size/test_codesize_minimal_pthreads.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 7529,
33
"a.out.js.gz": 3720,
4-
"a.out.nodebug.wasm": 19590,
5-
"a.out.nodebug.wasm.gz": 9031,
6-
"total": 27119,
7-
"total_gz": 12751,
4+
"a.out.nodebug.wasm": 19588,
5+
"a.out.nodebug.wasm.gz": 9025,
6+
"total": 27117,
7+
"total_gz": 12745,
88
"sent": [
99
"a (memory)",
1010
"b (emscripten_get_now)",

test/code_size/test_codesize_minimal_pthreads_memgrowth.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.out.js": 7956,
33
"a.out.js.gz": 3920,
4-
"a.out.nodebug.wasm": 19591,
5-
"a.out.nodebug.wasm.gz": 9031,
6-
"total": 27547,
7-
"total_gz": 12951,
4+
"a.out.nodebug.wasm": 19589,
5+
"a.out.nodebug.wasm.gz": 9025,
6+
"total": 27545,
7+
"total_gz": 12945,
88
"sent": [
99
"a (memory)",
1010
"b (emscripten_get_now)",

0 commit comments

Comments
 (0)