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

Commit f0688562 authored by Greg Kaiser's avatar Greg Kaiser Committed by android-build-merger
Browse files

Merge "SharedBuffer: Fix bug in return value of release()"

am: c064db48

Change-Id: I401318575ced17a94d19b47b2821ed4c310d9a03
parents 70f9a101 c064db48
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -112,7 +112,8 @@ void SharedBuffer::acquire() const {
int32_t SharedBuffer::release(uint32_t flags) const
{
    int32_t prev = 1;
    if (onlyOwner() || ((prev = mRefs.fetch_sub(1, std::memory_order_release) == 1)
    if (onlyOwner()
            || (((prev = mRefs.fetch_sub(1, std::memory_order_release)) == 1)
                && (atomic_thread_fence(std::memory_order_acquire), true))) {
        mRefs.store(0, std::memory_order_relaxed);
        if ((flags & eKeepStorage) == 0) {