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

Skip to content
Commit 30099479 authored by Keith Mok's avatar Keith Mok Committed by Shunkai Yao
Browse files

Fix race condition in thread creation

There is a race condition in thread creation in initializer list of a
class. If the thread is created in initializer list of a class, it must
be the last member variable of the class, as the thread is trying to
access some of the member variables in the thread which might not be
initialized yet.

There are two ways to fix this. One is to move the thread creation to
the constructor which all member variables of the class will be
initialized by that time or need to ensure the mThread variable is the
last variable of the class and the last one in the initializer list.

Bug: 235136279
Test: build
Change-Id: Iafb48377e29580cdfb30bedbd9e49c4b1ff6a148
Merged-In: Iafb48377e29580cdfb30bedbd9e49c4b1ff6a148
(cherry picked from commit 0897527f)
parent c0e340a2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment