Add Fence::waitForever which logs a warning timeout, and use it
Bug: 7217641
Change-Id: If0c1a613ead307c4045a47824174bf40c72bc7d7
diff --git a/include/ui/Fence.h b/include/ui/Fence.h
index b516a22..a8460c2 100644
--- a/include/ui/Fence.h
+++ b/include/ui/Fence.h
@@ -62,6 +62,13 @@
// indefinitely for the fence to signal.
int wait(unsigned int timeout);
+ // waitForever is a convenience function for waiting forever for a fence to
+ // signal (just like wait(TIMEOUT_NEVER)), but issuing an error to the
+ // system log and fence state to the kernel log if the wait lasts longer
+ // than warningTimeout. The logname argument should be a string identifying
+ // the caller and will be included in the log message.
+ int waitForever(unsigned int warningTimeout, const char* logname);
+
// TIMEOUT_NEVER may be passed to the wait method to indicate that it
// should wait indefinitely for the fence to signal.
enum { TIMEOUT_NEVER = -1 };