Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::ScopedSuspendPoint Class Reference

Brackets one call that may suspend the wasm stack under ASYNCIFY. More...

#include "donner/base/AsyncifySuspendProbe.h"

Public Member Functions

 ScopedSuspendPoint (SuspendKind kind)
 Open a suspend interval attributed to kind.
 ~ScopedSuspendPoint ()
 Close the interval and fold its wall time into the thread's totals.
 ScopedSuspendPoint (const ScopedSuspendPoint &)=delete
ScopedSuspendPointoperator= (const ScopedSuspendPoint &)=delete
 ScopedSuspendPoint (ScopedSuspendPoint &&)=delete
ScopedSuspendPointoperator= (ScopedSuspendPoint &&)=delete

Detailed Description

Brackets one call that may suspend the wasm stack under ASYNCIFY.

Declare it in the narrowest scope that contains the suspending call:

{
device.poll(false, nullptr);
}
ScopedSuspendPoint(SuspendKind kind)
Open a suspend interval attributed to kind.
@ DeviceWait
device.poll / instance.waitAny: emdawnwebgpu yields the Asyncify worker for roughly one browser task ...
Definition AsyncifySuspendProbe.h:42

Cheap enough to leave in release builds: two monotonic clock reads and a handful of thread-local adds. It is compiled on every platform so the desktop build exercises the same code the browser build measures.


The documentation for this class was generated from the following file: