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

Skip to content
Commit f280b020 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

liblog: resolve deadlocks (part deux)



(cherry pick from commit 2d2e0a5c)

Although ever present, an increased regression introduced with
commit b6bee331 (liblog: logd:
support logd.timestamp = monotonic).

A signal handler can interrupt in locked context, if log is written
in the signal handler, we are in deadlock. To reduce the contention
and chances for this problem separate out timestamp lock from is
loggable lock to reduce contention situations. Provide a best-guess
response if lock would fail in timestamp path.

Use a common lock() inline within each module, with a comment speaking
to the issues surrounding calling a function that has a mutex within
a signal handler.

ToDo: Hold off signals temporarily in mainline, restart when unblock.
      Can not use pthread_sigmask(SIG_BLOCK,,) as it breaks AtCmd.

Signed-off-by: default avatarMark Salyzyn <salyzyn@google.com>
Bug: 25563384
Change-Id: I47e2c87c988c3e359eb9eef129c6a3a08e9eedef
parent 67114e63
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment