summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2015-09-16 17:34:00 -0500
committerMark Salyzyn2015-10-07 18:23:57 -0500
commitde4bb9c1a704d0eab3320b43c3964342f4b662df (patch)
treea1ac6723198c8b39a8f4c6ae00a59fbbdaf4c80f /logd/LogTimes.cpp
parent603b8e50c8e542b4c0e51ed742a714cb14e8dd9b (diff)
downloadplatform-system-core-de4bb9c1a704d0eab3320b43c3964342f4b662df.tar.gz
platform-system-core-de4bb9c1a704d0eab3320b43c3964342f4b662df.tar.xz
platform-system-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
Diffstat (limited to 'logd/LogTimes.cpp')
-rw-r--r--logd/LogTimes.cpp7
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) {
128 128
129 lock(); 129 lock();
130 130
131 while (me->threadRunning && !me->isError_Locked()) { 131 uint64_t start = me->mStart;
132 uint64_t start = me->mStart;
133 132
133 while (me->threadRunning && !me->isError_Locked()) {
134 unlock(); 134 unlock();
135 135
136 if (me->mTail) { 136 if (me->mTail) {
@@ -143,8 +143,11 @@ void *LogTimeEntry::threadStart(void *obj) {
143 143
144 if (start == LogBufferElement::FLUSH_ERROR) { 144 if (start == LogBufferElement::FLUSH_ERROR) {
145 me->error_Locked(); 145 me->error_Locked();
146 break;
146 } 147 }
147 148
149 me->mStart = start + 1;
150
148 if (me->mNonBlock || !me->threadRunning || me->isError_Locked()) { 151 if (me->mNonBlock || !me->threadRunning || me->isError_Locked()) {
149 break; 152 break;
150 } 153 }