OSDN Git Service

Fix hang under BufferQueue::disconnect
authorAndy Ross <andy.ross@windriver.com>
Tue, 18 Dec 2012 20:54:32 +0000 (12:54 -0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 2 Aug 2013 04:20:35 +0000 (12:20 +0800)
commitc9120c52c71209bdebbf49c81132e18fd0f24952
treea9d926e570bfdf1458d019c8f982ee24a2940698
parentf26c78fe1fdd8d45bb27b807a03875a1af6cbc92
Fix hang under BufferQueue::disconnect

disconnect() tries to drain the queue, but there are error cases in
the wild where the consumer has "lost" the BufferQueue object and
stopped consuming frames.  That causes a deadlock situation where
disconnect (itself called from under cleanup code,
e.g. eglDestroySurface()) never returns and hangs the process.

Fix this by detecting (with a timeout) the case of a queue that fails
to drain promptly and convert it to an existing error, basically
treating it the same as "abandoned".

Issue: AXIA-582
Change-Id: I313f7fb038e6f61d02a23c3b0d4b6951c54d9f20
Signed-off-by: Andy Ross <andy.ross@windriver.com>
libs/gui/BufferQueue.cpp