Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9de2a60f authored by Lloyd Pique's avatar Lloyd Pique
Browse files

end2end: Introduce AsyncFunction [2/N]

AsyncFunction is a function object wrapper that provides some critical
thread safety guarantees while also striving to allow dynamic
connections between parts of the tests and framework/

In particular:

* Calls to an AsyncFunction target are serialized. The target will only
  be called by one thread at a time.
* The target the AsyncFunction will call can be changed at any time.
* AsyncFunction provides a synchronization point via a returned
  finalizer object from the call to set a new target. When this
  finalizer is explicitly invoked or destroyed, the finalizer waits for
  any calls to the replaced target to complete. After that finishes, any
  resources used by the replaced target can be freed if no longer
  needed.

This implementation is tricky enough that an internal test is needed,
which for simplicity runs with all the SurfaceFlinger integration tests.

Flag: TEST_ONLY
Bug: 372735083
Test: atest surfaceflinger_end2end_tests

Change-Id: I896ff759df514d18e5f3e079bce5f697f90124ea
parent 85add72b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment