Merge "emulator: opengl: Add support for unix sockets."
diff --git a/tools/emulator/opengl/Android.mk b/tools/emulator/opengl/Android.mk
index 939a363..8147395 100644
--- a/tools/emulator/opengl/Android.mk
+++ b/tools/emulator/opengl/Android.mk
@@ -12,7 +12,7 @@
 # By default, NEVER build the gralloc.goldfish support library because
 # the code has not been ported to Honeycomb / IceCreamSandwich yet and
 # will fail to build properly.
-BUILD_EMULATOR_OPENGL_DRIVER ?= false
+BUILD_EMULATOR_OPENGL_DRIVER ?= true
 
 # Top-level for all modules
 EMUGL_PATH := $(call my-dir)
diff --git a/tools/emulator/opengl/shared/OpenglOsUtils/osThreadUnix.cpp b/tools/emulator/opengl/shared/OpenglOsUtils/osThreadUnix.cpp
index 0cddb64..66611ee 100644
--- a/tools/emulator/opengl/shared/OpenglOsUtils/osThreadUnix.cpp
+++ b/tools/emulator/opengl/shared/OpenglOsUtils/osThreadUnix.cpp
@@ -27,6 +27,7 @@
 
 Thread::~Thread()
 {
+    pthread_mutex_destroy(&m_lock);
 }
 
 bool
diff --git a/tools/emulator/opengl/system/gralloc/gralloc.cpp b/tools/emulator/opengl/system/gralloc/gralloc.cpp
index 258b0db..9c3df97 100644
--- a/tools/emulator/opengl/system/gralloc/gralloc.cpp
+++ b/tools/emulator/opengl/system/gralloc/gralloc.cpp
@@ -13,7 +13,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-#include "gralloc_cb.h"
+#include <string.h>
 #include <pthread.h>
 #ifdef HAVE_ANDROID_OS      // just want PAGE_SIZE define
 # include <asm/page.h>
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <dlfcn.h>
 #include <sys/mman.h>
+#include "gralloc_cb.h"
 #include "HostConnection.h"
 #include "glUtils.h"
 #include <cutils/log.h>