summaryrefslogtreecommitdiff
path: root/base/errors_unix.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-11-06 12:26:52 -0800
committerMark Salyzyn <salyzyn@google.com>2015-11-19 13:14:16 -0800
commit2d2e0a5c5eb0b0ea2fe1349da50e22228965faf9 (patch)
treeef9d05a98bc0eb3fe698089c0701e1db503ced29 /base/errors_unix.cpp
parent9f903687011c195154b0c69c02e6aaa35c867242 (diff)
liblog: resolve deadlocks
Although ever present, an increased regression introduced with commit b6bee33182cedea49199eb2252b3f3b442899c6d (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: Mark Salyzyn <salyzyn@google.com> Bug: 25563384 Change-Id: I47e2c87c988c3e359eb9eef129c6a3a08e9eedef
Diffstat (limited to 'base/errors_unix.cpp')
0 files changed, 0 insertions, 0 deletions