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
Loading
Please register or sign in to comment