Skip to content

Commit 102aeeb

Browse files
committed
Use emscripten_has_threading_support. NFC
1 parent 429f70c commit 102aeeb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/library_pthread.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,13 +690,16 @@ 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+
#if ASSERTIONS
701+
dbg('pthread_create: environment does not support SharedArrayBuffer, pthreads are not available');
702+
#endif
700703
return {{{ cDefs.EAGAIN }}};
701704
}
702705
#if PTHREADS_DEBUG
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4951
1+
4911
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10465
1+
10376

0 commit comments

Comments
 (0)