xous-core/services/ime-plugin-api
bunnie 5f4678ca6a fix concurrency issue in predictor/redraw loop
So there's a bit of a nasty bug that arises from the GAM
both handling drawing primitives and context swaps.

In particular, because the GAM handles both of these in a
single thread, context swaps can't block, because the redraws
triggered by the context swap would be blocked, causing a deadlock.

When the API token for the predictor was introduced, this added
a blocking operation inside the context swap. This would cause
a deadlock under certain conditions.

This patch refactors the API token so that it's not a return
result of swapping the predictors. Instead, the predictors
return the API token as a non-blocking message to the GAM. This
API token is correlated with the *GAM* token (not the app token).
Present me thanks past me for adding the GAM token, which was
as of yet unused, but now, there is a very sensible role for it--
exactly what it was made for, e.g. handling GAM-local API calls
without disclosing the application token.

Anyways, hopefully this patch puts the race condition to
rest, while allowing us to have per-context prediction histories.
2022-06-20 03:05:16 +08:00
..
src fix concurrency issue in predictor/redraw loop 2022-06-20 03:05:16 +08:00
Cargo.toml