|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
The check every loop-owned body makes on entry: "am I on my owner?". More...
#include <atomic>#include <cassert>#include <core/async/IExecutor.hpp>#include <cstdio>Go to the source code of this file.
The check every loop-owned body makes on entry: "am I on my owner?".
A component whose state belongs to one executor (an IoLoop's loop, for the transports, the timeout scheduler and the network monitor) calls noteOwner(site, owner) at the top of each body that touches that state. In a debug build it asserts the calling thread is inside a task of owner.
A test replaces the assertion with an observation: it installs a probe, and every noteOwner hands the probe the site and the owner instead of asserting. The probe reads the executor scope itself, so a test proves the body ran posted without trusting the component's own answer, and a test that puts the wrong behaviour back sees a failed check rather than an abort.
Definition in file owner_probe.hpp.