diff options
| author | 2012-10-01 14:05:20 -0700 | |
|---|---|---|
| committer | 2012-10-02 16:29:46 -0700 | |
| commit | ba607d53c6a94ea8c4c12571980c4ad159af308b (patch) | |
| tree | 80458eab2d99780520b25b83b5c09ea13461387c /libs/ui/Fence.cpp | |
| parent | 2ae7bec77093744206080dbae020edfa3bfac2e1 (diff) | |
Add Fence::waitForever which logs a warning timeout, and use it
Bug: 7217641
Change-Id: If0c1a613ead307c4045a47824174bf40c72bc7d7
Diffstat (limited to 'libs/ui/Fence.cpp')
| -rw-r--r-- | libs/ui/Fence.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ui/Fence.cpp b/libs/ui/Fence.cpp index cec587613c..d2dbad276a 100644 --- a/libs/ui/Fence.cpp +++ b/libs/ui/Fence.cpp @@ -50,6 +50,20 @@ int Fence::wait(unsigned int timeout) { return sync_wait(mFenceFd, timeout); } +int Fence::waitForever(unsigned int warningTimeout, const char* logname) { + ATRACE_CALL(); + if (mFenceFd == -1) { + return NO_ERROR; + } + int err = sync_wait(mFenceFd, warningTimeout); + if (err == -ETIME) { + ALOGE("%s: fence %d didn't signal in %u ms", logname, mFenceFd, + warningTimeout); + err = sync_wait(mFenceFd, TIMEOUT_NEVER); + } + return err; +} + sp<Fence> Fence::merge(const String8& name, const sp<Fence>& f1, const sp<Fence>& f2) { ATRACE_CALL(); |