Skip to content

Commit 8c3abf4

Browse files
authored
1 parent 3d000e6 commit 8c3abf4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ See docs/process.md for more on how version tagging works.
3333
works with `for...of`/`Array.from()`/spread. (#25993)
3434
- ASYNCIFY/JSPI functions in JS library files can now be marked as `__async:
3535
'auto'`, which allows async JS function to be used unmodified with
36-
ASYNCIFY/JSPI. (#26130, #26019)
36+
ASYNCIFY/JSPI. In addition, when such function are also marked as `__proxy:
37+
'sync'` it is now possible for them to be called from back background threads
38+
with the same blocking semantics. (#26130, #26019, #26000)
3739
- SDL3 port updated to 3.2.30. (#26135)
3840

3941
4.0.23 - 01/10/26

site/source/docs/porting/pthreads.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ In addition, Emscripten currently has a simple model of file I/O only happening
5959
on the main application thread (as we support JS plugin filesystems, which
6060
cannot share memory); this is another set of operations that are proxied.
6161

62+
When a JS library function is marked as both ``__proxy: 'sync'`` and ``__proxy:
63+
'async'`` the calling thread will block until the async operation on the
64+
main thread is completed (i.e. the returned promise is resolved).
65+
6266
Proxying can cause problems in certain cases, see the section on blocking below.
6367

6468
Blocking on the main browser thread

src/lib/libpthread.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ var LibraryPThread = {
12241224
_emscripten_dlsync_threads: () => {
12251225
const callingThread = PThread.currentProxiedOperationCallerThread;
12261226
if (callingThread) {
1227-
return dlsyncThreadsAsync()
1227+
return dlsyncThreadsAsync();
12281228
}
12291229
for (const ptr of Object.keys(PThread.pthreads)) {
12301230
const pthread_ptr = Number(ptr);

0 commit comments

Comments
 (0)