logd: update region lock after entry has passed to reader socket

(cherry pick from commit de4bb9c1a7)

- 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
This commit is contained in:
Mark Salyzyn 2015-09-16 15:34:00 -07:00 committed by Rom Lemarchand
parent b04352e597
commit 70cbe025f4

View file

@ -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;
}