Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions site/source/docs/porting/asyncify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ You will see something like this:
That shows that the C code only continued to execute after the async JS
completed.

.. _marking_async_functions:

Marking JS library functions as async
#####################################

Expand Down
7 changes: 5 additions & 2 deletions site/source/docs/porting/pthreads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ can also be used directly for more precise control over how work is run on
different threads.

When a JS library function is marked as both ``__proxy: 'sync'`` and ``__async:
'auto'`` the calling thread will block until the async operation on the
main thread is completed (i.e. the returned promise is resolved). This allows
'auto'``, it is expected to return a promise
(see :ref:`marking_async_functions`).
The calling thread will block until the async operation on the
main thread is completed (i.e. the returned promise is resolved), and the value
that the promise resolves to will be returned to the caller. This allows
functions that would require :ref:`ASYNCIFY` (when called from the main browser
thread) to be called without :ref:`ASYNCIFY` from a background thread. In other
words, background threads can block on proxied work even without :ref:`ASYNCIFY`
Expand Down