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

Commit 70d2598c authored by Dan Stoza's avatar Dan Stoza Committed by android-build-merger
Browse files

libui: Add hasSignaled() method to Fence am: 5736f7dc

am: 236c475d

Change-Id: I31c163114384d0db3fabe52cd24fddc322d300e1
parents 4802d350 236c475d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -96,6 +96,17 @@ public:
    // occurs then -1 is returned.
    nsecs_t getSignalTime() const;

    // hasSignaled returns whether the fence has signaled yet. Prefer this to
    // getSignalTime() or wait() if all you care about is whether the fence has
    // signaled.
    inline bool hasSignaled() {
        // The sync_wait call underlying wait() has been measured to be
        // significantly faster than the sync_fence_info call underlying
        // getSignalTime(), which might otherwise appear to be the more obvious
        // way to check whether a fence has signaled.
        return wait(0) == NO_ERROR;
    }

    // Flattenable interface
    size_t getFlattenedSize() const;
    size_t getFdCount() const;