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

Skip to content
Commit b30a1b4e authored by Abdelrahman Daim's avatar Abdelrahman Daim
Browse files

Fix race condition in process observer



Summary: There is a race condition in dispatching the changes to the process
observer. When a ProcessChangeItem is initialized and retrieved during
enqueueProcessChangeItemLocked(), the change information will be set
with the handle retrieved. The change item will be processed in the UI
thread via a message.
However, there could be race condition. When the change item is
processed in the UI thread, its actual change information is not yet
populated and hence the dispatch will find no changes and do nothing.
This diff makes creating the ProcessChangeItem to be atomic so that
when the message to process is sent, it will have all the information.

Test: Successful build on master

Signed-off-by: default avatarAbdelrahman Daim <adaim@meta.com>

Change-Id: I5e0e5992c41dfd59c23bacdefcd8a294b13fc6be
parent f824197c
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