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 way 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: Ic7322d72305b4320121aad1d7872734d2d395150
Loading
Please register or sign in to comment