summaryrefslogtreecommitdiffstats
path: root/sensors
diff options
context:
space:
mode:
authorAnthony Stange <stange@google.com>2019-07-15 17:50:18 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-07-15 17:50:18 -0700
commitf75cf1cf4d32bb8c978d3fc3804240036f35bf9b (patch)
tree564d24a3bc25790e248feeb5072a5adb414716d8 /sensors
parentf829d259567391ad82e9ab96b91b4463ac854193 (diff)
parent65945cfb150ee6f046daa472b4ce71729ee69f1b (diff)
downloadandroid_hardware_interfaces-f75cf1cf4d32bb8c978d3fc3804240036f35bf9b.tar.gz
android_hardware_interfaces-f75cf1cf4d32bb8c978d3fc3804240036f35bf9b.tar.bz2
android_hardware_interfaces-f75cf1cf4d32bb8c978d3fc3804240036f35bf9b.zip
Verify mPollThread is joinable before detaching
am: 65945cfb15 Change-Id: Iee183865223aa993241c19924245177b3462d4da
Diffstat (limited to 'sensors')
-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 affdf8b6b..fa0e2e9bf 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) {