Skip to content

Commit a95d758

Browse files
authored
[musl] Always cancelasync as a boolean. NFC (emscripten-core#26532)
This is how all the other code in musl already treats it.
1 parent 26c8e9d commit a95d758

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

system/lib/pthread/emscripten_futex_wait.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ int emscripten_futex_wait(volatile void *addr, uint32_t val, double max_wait_ms)
131131

132132
#ifdef __EMSCRIPTEN_PTHREADS__
133133
pthread_t self = pthread_self();
134-
bool cancelable = self->cancelasync == PTHREAD_CANCEL_ASYNCHRONOUS;
134+
bool cancelable = self->cancelasync;
135135
#else
136136
bool cancelable = false;
137137
#endif

system/lib/pthread/pthread_create.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void _emscripten_thread_exit(void* result) {
309309
assert(self);
310310

311311
self->canceldisable = PTHREAD_CANCEL_DISABLE;
312-
self->cancelasync = PTHREAD_CANCEL_DEFERRED;
312+
self->cancelasync = 0;
313313
self->result = result;
314314

315315
_emscripten_thread_mailbox_shutdown(self);

test/codesize/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": 7364,
33
"a.out.js.gz": 3607,
4-
"a.out.nodebug.wasm": 19263,
5-
"a.out.nodebug.wasm.gz": 8934,
6-
"total": 26627,
7-
"total_gz": 12541,
4+
"a.out.nodebug.wasm": 19259,
5+
"a.out.nodebug.wasm.gz": 8931,
6+
"total": 26623,
7+
"total_gz": 12538,
88
"sent": [
99
"a (memory)",
1010
"b (emscripten_get_now)",

test/codesize/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": 7766,
33
"a.out.js.gz": 3812,
4-
"a.out.nodebug.wasm": 19264,
5-
"a.out.nodebug.wasm.gz": 8935,
6-
"total": 27030,
7-
"total_gz": 12747,
4+
"a.out.nodebug.wasm": 19260,
5+
"a.out.nodebug.wasm.gz": 8933,
6+
"total": 27026,
7+
"total_gz": 12745,
88
"sent": [
99
"a (memory)",
1010
"b (emscripten_get_now)",

0 commit comments

Comments
 (0)