Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f75cf1cf authored by Anthony Stange's avatar Anthony Stange Committed by android-build-merger
Browse files

Verify mPollThread is joinable before detaching

am: 65945cfb

Change-Id: Iee183865223aa993241c19924245177b3462d4da
parents f829d259 65945cfb
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -29,8 +29,10 @@ void SensorsHidlEnvironmentBase::HidlSetUp() {

void SensorsHidlEnvironmentBase::HidlTearDown() {
    mStopThread = true;
    if (mPollThread.joinable()) {
        mPollThread.detach();
    }
}

void SensorsHidlEnvironmentBase::catEvents(std::vector<Event>* output) {
    std::lock_guard<std::mutex> lock(mEventsMutex);