aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/libs/Translator/include
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/host/libs/Translator/include
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/host/libs/Translator/include')
-rw-r--r--emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h6
-rw-r--r--emulator/opengl/host/libs/Translator/include/GLcommon/GLEScontext.h4
-rw-r--r--emulator/opengl/host/libs/Translator/include/GLcommon/objectNameManager.h8
3 files changed, 9 insertions, 9 deletions
diff --git a/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h b/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h
index de7d563..18a989c 100644
--- a/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h
+++ b/emulator/opengl/host/libs/Translator/include/GLcommon/GLDispatch.h
@@ -18,7 +18,7 @@
#include <GLES/gl.h>
#include <GLES2/gl2.h>
-#include <utils/threads.h>
+#include "emugl/common/mutex.h"
#include "gldefs.h"
#include "GLutils.h"
@@ -260,8 +260,8 @@ public:
static void (GL_APIENTRY *glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
private:
- bool m_isLoaded;
- static android::Mutex s_lock;
+ bool m_isLoaded;
+ static emugl::Mutex s_lock;
};
#endif
diff --git a/emulator/opengl/host/libs/Translator/include/GLcommon/GLEScontext.h b/emulator/opengl/host/libs/Translator/include/GLcommon/GLEScontext.h
index 20509fc..5aed0ad 100644
--- a/emulator/opengl/host/libs/Translator/include/GLcommon/GLEScontext.h
+++ b/emulator/opengl/host/libs/Translator/include/GLcommon/GLEScontext.h
@@ -20,7 +20,7 @@
#include "GLDispatch.h"
#include "GLESpointer.h"
#include "objectNameManager.h"
-#include <utils/threads.h>
+#include "emugl/common/mutex.h"
#include <string>
typedef std::map<GLenum,GLESpointer*> ArraysMap;
@@ -187,7 +187,7 @@ protected:
void initCapsLocked(const GLubyte * extensionString);
virtual void initExtensionString() =0;
- static android::Mutex s_lock;
+ static emugl::Mutex s_lock;
static GLDispatch s_glDispatch;
bool m_initialized;
unsigned int m_activeTexture;
diff --git a/emulator/opengl/host/libs/Translator/include/GLcommon/objectNameManager.h b/emulator/opengl/host/libs/Translator/include/GLcommon/objectNameManager.h
index 0a00644..4d4d038 100644
--- a/emulator/opengl/host/libs/Translator/include/GLcommon/objectNameManager.h
+++ b/emulator/opengl/host/libs/Translator/include/GLcommon/objectNameManager.h
@@ -16,8 +16,8 @@
#ifndef _OBJECT_NAME_MANAGER_H
#define _OBJECT_NAME_MANAGER_H
-#include <cutils/threads.h>
#include <map>
+#include "emugl/common/mutex.h"
#include "emugl/common/smart_ptr.h"
enum NamedObjectType {
@@ -129,7 +129,7 @@ public:
void deleteName(NamedObjectType p_type, unsigned int p_name);
private:
- mutex_t m_lock;
+ emugl::Mutex m_lock;
};
//
@@ -204,7 +204,7 @@ private:
~ShareGroup();
private:
- mutex_t m_lock;
+ emugl::Mutex m_lock;
NameSpace *m_nameSpace[NUM_OBJECT_TYPES];
void *m_objectsData;
};
@@ -262,7 +262,7 @@ public:
private:
ShareGroupsMap m_groups;
- mutex_t m_lock;
+ emugl::Mutex m_lock;
GlobalNameSpace *m_globalNameSpace;
};