summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/renderthread/RenderProxy.cpp1
-rw-r--r--libs/hwui/thread/Signal.h6
-rw-r--r--libs/hwui/thread/TaskManager.cpp7
3 files changed, 10 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index ea4216c..0091790 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -418,6 +418,7 @@ CREATE_BRIDGE2(dumpGraphicsMemory, int fd, RenderThread* thread) {
}
void RenderProxy::dumpGraphicsMemory(int fd) {
+ if (!RenderThread::hasInstance()) return;
SETUP_TASK(dumpGraphicsMemory);
args->fd = fd;
args->thread = &RenderThread::getInstance();
diff --git a/libs/hwui/thread/Signal.h b/libs/hwui/thread/Signal.h
index dcf5449..d4cfeeb 100644
--- a/libs/hwui/thread/Signal.h
+++ b/libs/hwui/thread/Signal.h
@@ -30,8 +30,10 @@ public:
~Signal() { }
void signal() {
- Mutex::Autolock l(mLock);
- mSignaled = true;
+ {
+ Mutex::Autolock l(mLock);
+ mSignaled = true;
+ }
mCondition.signal(mType);
}
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp
index c69b2fd..f0ed0bb 100644
--- a/libs/hwui/thread/TaskManager.cpp
+++ b/libs/hwui/thread/TaskManager.cpp
@@ -109,8 +109,11 @@ bool TaskManager::WorkerThread::addTask(TaskWrapper task) {
return false;
}
- Mutex::Autolock l(mLock);
- ssize_t index = mTasks.add(task);
+ ssize_t index;
+ {
+ Mutex::Autolock l(mLock);
+ index = mTasks.add(task);
+ }
mSignal.signal();
return index >= 0;