Loading cmds/lshal/Timeout.h +7 −3 Original line number Diff line number Diff line Loading @@ -72,10 +72,14 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func return false; } bool success = state.wait(now + delay); if (!success) { pthread_kill(thread, SIGINT); } 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); } return success; } Loading cmds/lshal/main.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -18,5 +18,6 @@ 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}); } Loading
cmds/lshal/Timeout.h +7 −3 Original line number Diff line number Diff line Loading @@ -72,10 +72,14 @@ bool timeout(std::chrono::duration<R, P> delay, std::function<void(void)> &&func return false; } bool success = state.wait(now + delay); if (!success) { pthread_kill(thread, SIGINT); } 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); } return success; } Loading
cmds/lshal/main.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -18,5 +18,6 @@ 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}); }