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

Skip to content
Commit bd70b8a0 authored by Diogo Ferreira's avatar Diogo Ferreira Committed by Diogo Ferreira
Browse files

FileManager: Editor: Fix race on completion wait/notify

The async reader is racing with the completion handler and when reading
a small enough file the notification may happen before the handler ever
waits.

This patch adds a condition flag under the mSync lock and only ever
waits if the completion wasn't done already.

This also fixes a potential spurious wakeup issue with the previous code
where the wait thread could be woken by a spurious wakeup without the
read being completed.

Change-Id: Ie3e6ead942c0f00dbb3e44591be19634706ee206
parent 578f0a0e
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