aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/tests
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-03-10 15:16:30 +0100
committerDavid 'Digit' Turner <digit@google.com>2014-03-11 10:24:51 +0100
commitaac93f1585bc9bdf8a57b6ed3c47c24f56a3990a (patch)
tree27409568ac69f1efca05cbe75bc10883088db5c2 /emulator/opengl/tests
parentfd8752eb6a438832e0ba9a19db896614403f8945 (diff)
downloadsdk-aac93f1585bc9bdf8a57b6ed3c47c24f56a3990a.zip
sdk-aac93f1585bc9bdf8a57b6ed3c47c24f56a3990a.tar.gz
sdk-aac93f1585bc9bdf8a57b6ed3c47c24f56a3990a.tar.bz2
emulator/opengl: Remove android::Mutex.
This patch removes the dependency on android::Mutex from <cutils/threads.h> by providing a custom implementation, which is a simple wrapper around pthread_mutex_t / CriticalSection, under shared/emugl/common/mutex.h + Provide unit tests. Change-Id: I379ef0c480c478ab9ba5f2faaf8274267eff37ba
Diffstat (limited to 'emulator/opengl/tests')
-rw-r--r--emulator/opengl/tests/ut_renderer/Renderer.cpp12
-rw-r--r--emulator/opengl/tests/ut_renderer/Renderer.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/emulator/opengl/tests/ut_renderer/Renderer.cpp b/emulator/opengl/tests/ut_renderer/Renderer.cpp
index 22afadb..1102014 100644
--- a/emulator/opengl/tests/ut_renderer/Renderer.cpp
+++ b/emulator/opengl/tests/ut_renderer/Renderer.cpp
@@ -56,7 +56,7 @@ Renderer::Renderer()
int Renderer::createSurface(RenderingThread *thread, const ClientHandle & handle)
{
- android::Mutex::Autolock(this->m_mutex);
+ emugl::Mutex::AutoLock(this->m_mutex);
assert(m_surfaces.find(handle) == m_surfaces.end());
if (handle.handle == 0) {
@@ -75,7 +75,7 @@ int Renderer::createSurface(RenderingThread *thread, const ClientHandle & handle
int Renderer::destroySurface(RenderingThread *thread, const ClientHandle &handle)
{
- android::Mutex::Autolock(this->m_mutex);
+ emugl::Mutex::AutoLock(this->m_mutex);
SurfaceMap::iterator i = m_surfaces.find(handle);
if (i == m_surfaces.end()) {
@@ -90,7 +90,7 @@ int Renderer::destroySurface(RenderingThread *thread, const ClientHandle &handle
int Renderer::createContext(RenderingThread *thread, const ClientHandle &handle, ClientHandle shareCtx, int version)
{
- android::Mutex::Autolock(this->m_mutex);
+ emugl::Mutex::AutoLock(this->m_mutex);
assert(m_ctxs.find(handle) == m_ctxs.end());
RendererContext *shared = NULL;
@@ -115,7 +115,7 @@ int Renderer::createContext(RenderingThread *thread, const ClientHandle &handle,
int Renderer::destroyContext(RenderingThread *thread, const ClientHandle &handle)
{
- android::Mutex::Autolock(this->m_mutex);
+ emugl::Mutex::AutoLock(this->m_mutex);
ContextMap::iterator i = m_ctxs.find(handle);
if (i == m_ctxs.end()) {
@@ -133,7 +133,7 @@ int Renderer::makeCurrent(RenderingThread *thread,
const ClientHandle &readSurface,
const ClientHandle & ctx)
{
- android::Mutex::Autolock(this->m_mutex);
+ emugl::Mutex::AutoLock(this->m_mutex);
RendererContext *currentContext = thread->currentContext();
@@ -172,7 +172,7 @@ int Renderer::makeCurrent(RenderingThread *thread,
int Renderer::swapBuffers(RenderingThread *thread,
const ClientHandle &surface)
{
- android::Mutex::Autolock(this->m_mutex);
+ emugl::Mutex::AutoLock(this->m_mutex);
SurfaceMap::iterator s = m_surfaces.find(surface);
if (s == m_surfaces.end()) {
diff --git a/emulator/opengl/tests/ut_renderer/Renderer.h b/emulator/opengl/tests/ut_renderer/Renderer.h
index cdf10b6..81f4077 100644
--- a/emulator/opengl/tests/ut_renderer/Renderer.h
+++ b/emulator/opengl/tests/ut_renderer/Renderer.h
@@ -19,7 +19,7 @@
#include "RendererSurface.h"
#include "RendererContext.h"
#include "NativeWindowing.h"
-#include <utils/threads.h>
+#include "emugl/common/mutex.h"
class RenderingThread;
@@ -57,6 +57,6 @@ private:
NativeWindowing *m_nw;
EGLDisplay m_dpy;
- android::Mutex m_mutex; // single global mutex for the renderer class;
+ emugl::Mutex m_mutex; // single global mutex for the renderer class;
};
#endif