Skip to content

Commit 297ff73

Browse files
committed
Avoid unnecessary main browser check
emscripten_check_blocking_allowed will do this for us.
1 parent b83f013 commit 297ff73

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

system/lib/libc/musl/src/thread/pthread_cond_timedwait.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ int __pthread_cond_timedwait(pthread_cond_t *restrict c, pthread_mutex_t *restri
7777

7878
#ifdef __EMSCRIPTEN__
7979
// TODO: Optimize this away in MINIMAL_RUNTIME.
80-
if (emscripten_is_main_browser_thread()) {
81-
emscripten_check_blocking_allowed();
82-
}
80+
emscripten_check_blocking_allowed();
8381
#endif
8482

8583
if ((m->_m_type&15) && (m->_m_lock&INT_MAX) != __pthread_self()->tid)

system/lib/libc/musl/src/thread/pthread_join.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ static int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec
1313
if (!t || t->self != t) {
1414
return ESRCH;
1515
}
16-
int is_browser_thread = emscripten_is_main_browser_thread();
1716
#endif
1817

1918
int state, cs, r = 0;
@@ -29,9 +28,8 @@ static int __pthread_timedjoin_np(pthread_t t, void **res, const struct timespec
2928
}
3029
// XXX Emscripten we need to check if blocking is allowed when the initially state is joinable.
3130
// Note that detached and exiting/exited threads can be joined without blocking.
32-
if (r == 0 && state == DT_JOINABLE && is_browser_thread) {
31+
if (r == 0 && state == DT_JOINABLE)
3332
emscripten_check_blocking_allowed();
34-
}
3533
#else
3634
if (state >= DT_DETACHED) a_crash();
3735
#endif

0 commit comments

Comments
 (0)