Skip to content

Commit

Permalink
fixed for 2.0.34
Browse files Browse the repository at this point in the history
  • Loading branch information
tklajnscek committed Nov 16, 2021
1 parent 7a429c9 commit a92f951
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 4 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,10 @@ def default_setting(name, new_default):
'_pthread_testcancel',
'_exit',
]
if settings.ENVIRONMENT_MAY_BE_AUDIOWORKLET:
settings.EXPORTED_FUNCTIONS += [
'_pthread_create',
]
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += [
'$exitOnMainThread',
]
Expand Down
6 changes: 2 additions & 4 deletions src/library_pthread.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ var LibraryPThread = {
PThread.unusedWorkers[0].postMessage(PThread.buildWorkerLoadMessage());
}
return PThread.unusedWorkers.pop();
}
},

busySpinWait: function(msecs) {
var t = performance.now() + msecs;
Expand Down Expand Up @@ -489,9 +489,7 @@ var LibraryPThread = {
// This is sent from the worklet after the worker.js has processed the 'load'
// commands and needs to load the main js (which it can't do directly in
// AudioWorkletGlobalScope so we do it here from the main thread)
aw.addModule((Module['mainScriptUrlOrBlob'] || _scriptDir)).then(function() {
dummy.postMessage({'cmd': 'moduleloaded'});
});
aw.addModule((Module['mainScriptUrlOrBlob'] || _scriptDir));
} else if (cmd === 'running') {
// This is notified to let us know the pthread environment is ready and we can go ahead
// and create any pending AudioWorkletNodes
Expand Down

0 comments on commit a92f951

Please sign in to comment.