Make mMutex the last attribute to be released
The original attribute declaration order was mTimeKeeper -> mMutex. This will cause the mMutex be released prior than mTimeKeepr. When mMutex has been released and mTimeKeeper is still running dispatch(), the callback can be invoked and try to lock the released mMutex. Please check the error in https://b.corp.google.com/issues/284388255#comment37. This CL change the declaration order as mMutex -> mTimekeeper so that the release order become mTimeKeeper -> mMutex. When releasing mTimeKeeper, the ~Timer() will join the dispatch thread and thus ensure the callback won't be invoked after mMutex get released. Bug: 284388255 Test: Build, flash and run suspend<->resume test for over 96 hours. Change-Id: I75a3946e641cbe19a0caaeb91433010edcd9c0c7
Loading
Please register or sign in to comment