Skip to content

Commit 27c5982

Browse files
committed
Use emscripten_has_threading_support. NFC
1 parent 429f70c commit 27c5982

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/library_pthread.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,13 +690,14 @@ var LibraryPThread = {
690690
__pthread_create_js__noleakcheck: true,
691691
#endif
692692
__pthread_create_js__deps: ['$spawnThread', 'pthread_self', '$pthreadCreateProxied',
693+
'emscripten_has_threading_support',
693694
#if OFFSCREENCANVAS_SUPPORT
694695
'malloc',
695696
#endif
696697
],
697698
__pthread_create_js: (pthread_ptr, attr, startRoutine, arg) => {
698-
if (typeof SharedArrayBuffer == 'undefined') {
699-
err('Current environment does not support SharedArrayBuffer, pthreads are not available!');
699+
if (!_emscripten_has_threading_support()) {
700+
err('pthread_create: environment does not support SharedArrayBuffer, pthreads are not available');
700701
return {{{ cDefs.EAGAIN }}};
701702
}
702703
#if PTHREADS_DEBUG
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4951
1+
4953
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10465
1+
10472

0 commit comments

Comments
 (0)