diff options
author | Mark Salyzyn <salyzyn@google.com> | 2015-09-16 15:34:00 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2015-10-07 16:23:57 -0700 |
commit | de4bb9c1a704d0eab3320b43c3964342f4b662df (patch) | |
tree | a1ac6723198c8b39a8f4c6ae00a59fbbdaf4c80f | |
parent | 603b8e50c8e542b4c0e51ed742a714cb14e8dd9b (diff) | |
download | core-de4bb9c1a704d0eab3320b43c3964342f4b662df.tar.gz core-de4bb9c1a704d0eab3320b43c3964342f4b662df.tar.bz2 core-de4bb9c1a704d0eab3320b43c3964342f4b662df.zip |
logd: update region lock after entry has passed to reader socket
- The reader region level indicates the location to protect, but once
it has been passed to the calling reader, then allow us to go
one beyond so that a clear or prune thread can remove the entry.
Bug: 23711431
Change-Id: I0f2389858dd8c83366c034360f67d7c363625b56
-rw-r--r-- | logd/LogTimes.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/logd/LogTimes.cpp b/logd/LogTimes.cpp index 68a068008..229be3cd5 100644 --- a/logd/LogTimes.cpp +++ b/logd/LogTimes.cpp @@ -128,9 +128,9 @@ void *LogTimeEntry::threadStart(void *obj) { lock(); - while (me->threadRunning && !me->isError_Locked()) { - uint64_t start = me->mStart; + uint64_t start = me->mStart; + while (me->threadRunning && !me->isError_Locked()) { unlock(); if (me->mTail) { @@ -143,8 +143,11 @@ void *LogTimeEntry::threadStart(void *obj) { if (start == LogBufferElement::FLUSH_ERROR) { me->error_Locked(); + break; } + me->mStart = start + 1; + if (me->mNonBlock || !me->threadRunning || me->isError_Locked()) { break; } |