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

Commit ef2e1643 authored by Yifan Hong's avatar Yifan Hong Committed by Gerrit Code Review
Browse files

Merge "Revert "lshal: do not pthread_kill"" into main

parents 96b83024 4a9ad85b
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -72,14 +72,10 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func
        return false;
    }
    bool success = state.wait(now + delay);
    if (success) {
        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);
    if (!success) {
        pthread_kill(thread, SIGINT);
    }
    pthread_join(thread, nullptr);
    return success;
}

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

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