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

Commit 67530d65 authored by Hugo Benichi's avatar Hugo Benichi
Browse files

Add volatile qualifier to boolean variable

DHCP receive thread was spinning on a boolean variable to know when to
stop. That variable had no volatile qualifier, potentially preventing
the thread from stopping at all. Without a volatile qualifier, the reads
and writes in halt() could be reordered in such a way that the running
thread is interrupted before mStopped is set t true. Also, the optimizer
could decide to hoist mStopped in a register inside the running thread,
preventing the loop from exiting.

Change-Id: I5b30c1247808114f0e5b46e230978ee7ea18ab8e
parent 6b34b310
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