diff options
| author | 2023-12-18 17:39:20 -0800 | |
|---|---|---|
| committer | 2023-12-19 15:56:13 -0800 | |
| commit | 9e509aba9efba4de1253acd332745521d571a474 (patch) | |
| tree | b661fddc3dad8fb5141719b4e26e698728916770 /libs/ultrahdr/jpegencoderhelper.cpp | |
| parent | 7b05d26f3fee877185cc4889ade918ec38dbcf76 (diff) | |
lshal: use std::async
All of the commands are executed by starting a thread,
and if there is a timeout, sending a SIGINT to the thread,
which invokes pthread_exit from the signal handler. If
pthread_exit is called while the thread is in jemalloc code,
that might cause problems.
Use a standard library std::async function to avoid handling
pthread's manually. This avoids calling pthread_kill(). If
the function times out, simply ignore the future object and
move on. Although this causes memory leak, the lshal tool is
a debugging tool that is intended to run for a short period of
time, not as a daemon. So this is okay.
Test: lshal_test
Bug: 311143089
Change-Id: Id1092fbc3992c62c13c66ddac18105e8dcd6fc81
Diffstat (limited to 'libs/ultrahdr/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions