summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-11-18 22:25:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-11-18 22:25:16 +0000
commitebb71b593bc72ef63e516c91dc878d54a3ff9eff (patch)
tree6696482bfe7159b76aeec3c15e9dbcadab401a62
parenta3d5ee35e40ca12d412306d8042466005be7e2a4 (diff)
parent53f2200ea463d90ddc678b3a7855b3014ad1923c (diff)
Merge "Verify mPollThread is joinable before detaching" into android10-tests-dev
-rw-r--r--sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp b/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp
index affdf8b6b3..fa0e2e9bf0 100644
--- a/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp
+++ b/sensors/common/vts/utils/SensorsHidlEnvironmentBase.cpp
@@ -29,7 +29,9 @@ void SensorsHidlEnvironmentBase::HidlSetUp() {
void SensorsHidlEnvironmentBase::HidlTearDown() {
mStopThread = true;
- mPollThread.detach();
+ if (mPollThread.joinable()) {
+ mPollThread.detach();
+ }
}
void SensorsHidlEnvironmentBase::catEvents(std::vector<Event>* output) {