Merge "Call pthread_join to clean up watchdog thread" into oc-mr1-dev am: 6e680854ed
am: 9ca2306402
Change-Id: I340076ad83dd4dce691e67fafbd70643c14ffba1
This commit is contained in:
@@ -503,6 +503,10 @@ class WatchDog {
|
||||
status_ = OEMCrypto_ERROR_INIT_FAILED;
|
||||
LOGE("XXX WATCH DOG ERROR XXX");
|
||||
SaveFailureInformation();
|
||||
// This tells the worker thread to clean up after itself. It is not
|
||||
// really needed since we are going to abort. However, if somebody
|
||||
// removes the "abort()" below, then this is needed.
|
||||
pthread_detach(thread_);
|
||||
// This is controversial. The argument for an abort here is that if we
|
||||
// do not abort, we will suck all the life out of the user's battery. By
|
||||
// saving information to the file system, above, we can still track
|
||||
@@ -514,7 +518,10 @@ class WatchDog {
|
||||
bool should_delete = !gave_up_;
|
||||
OEMCryptoResult status = status_;
|
||||
pthread_mutex_unlock(&mutex_);
|
||||
if (should_delete) delete this;
|
||||
if (should_delete) {
|
||||
pthread_join(thread_, NULL);
|
||||
delete this;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user