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

Commit de4bb9c1 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

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
parent 603b8e50
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -128,9 +128,9 @@ void *LogTimeEntry::threadStart(void *obj) {

    lock();

    while (me->threadRunning && !me->isError_Locked()) {
    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;
        }