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

Skip to content
Commit 8d7d0f42 authored by Alec Mouri's avatar Alec Mouri
Browse files

Use semaphore instead of condition variable

BackgroundExecutor uses a condition variable to synchronize processing
to a work queue, which means that there is possible mutex contention on
the main thread in rare scenarios.

Instead, we can make the main thread non-blocking with a thread-safe
queue, and use semaphores for signaling the background thread to wake
up. Using semaphores saves a small number of instructions, but overall
reduces contention

Bug: 232113929
Test: bouncy ball

Change-Id: Iced25e8349bdb2a70cac1ed681059a0b14258407
parent 04d24da3
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