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

Commit 9802ce53 authored by Yifan Hong's avatar Yifan Hong Committed by Automerger Merge Worker
Browse files

Merge "lshal: do not pthread_kill" into main am: c2d75ce4 am: bfc54991

parents 66a34017 bfc54991
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -72,10 +72,14 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func
        return false;
        return false;
    }
    }
    bool success = state.wait(now + delay);
    bool success = state.wait(now + delay);
    if (!success) {
    if (success) {
        pthread_kill(thread, SIGINT);
    }
        pthread_join(thread, nullptr);
        pthread_join(thread, nullptr);
    } else {
        // b/311143089: Abandon this background thread. Resources for a detached
        // thread are cleaned up when it is terminated. If the background thread
        // is stalled, it will be terminated when returning from main().
        pthread_detach(thread);
    }
    return success;
    return success;
}
}


+1 −0
Original line number Original line Diff line number Diff line
@@ -18,5 +18,6 @@


int main(int argc, char **argv) {
int main(int argc, char **argv) {
    using namespace ::android::lshal;
    using namespace ::android::lshal;
    // Background pthreads from timeout() are destroyed upon returning from main().
    return Lshal{}.main(Arg{argc, argv});
    return Lshal{}.main(Arg{argc, argv});
}
}