aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-07-21 14:09:58 +0000
committerandroid-build-merger <android-build-merger@google.com>2014-07-21 14:09:58 +0000
commit245fae139423eb268ecb3eaa06f6ce8c7044c4f4 (patch)
treefc01b3b4058b56bddaee59c6e1fddf81c789fe8b
parent801ded09185251fdc9d8f9e90f5d563e6cedba14 (diff)
parentd1dd8ee1e85f60569ddf6ebc7fe1cbde7ebb6f38 (diff)
downloadsdk-245fae139423eb268ecb3eaa06f6ce8c7044c4f4.zip
sdk-245fae139423eb268ecb3eaa06f6ce8c7044c4f4.tar.gz
sdk-245fae139423eb268ecb3eaa06f6ce8c7044c4f4.tar.bz2
Merge "emulator/opengl: Add global lock to libOpenglRender." into idea133
automerge: d1dd8ee * commit 'd1dd8ee1e85f60569ddf6ebc7fe1cbde7ebb6f38': emulator/opengl: Add global lock to libOpenglRender. Move SdkVersionInfo from sdk-common to sdklib, part 3.
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java6
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java2
-rw-r--r--emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp3
-rw-r--r--emulator/opengl/host/libs/libOpenglRender/RenderServer.h2
-rw-r--r--emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp19
-rw-r--r--emulator/opengl/host/libs/libOpenglRender/RenderThread.h7
9 files changed, 24 insertions, 21 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
index 11896d8..93cd2da 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
@@ -22,7 +22,7 @@ import static org.eclipse.ui.IWorkbenchPage.MATCH_INPUT;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.ide.common.sdk.SdkVersionInfo;
+import com.android.sdklib.SdkVersionInfo;
import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
import com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart;
import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java
index b047b1b..1a7fe56 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAnnotation.java
@@ -25,7 +25,7 @@ import static org.eclipse.jdt.core.dom.SingleMemberAnnotation.VALUE_PROPERTY;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.ide.common.sdk.SdkVersionInfo;
+import com.android.sdklib.SdkVersionInfo;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.IconFactory;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
index b77b475..88e0880 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/AddSuppressAttribute.java
@@ -22,7 +22,7 @@ import static com.android.SdkConstants.DOT_XML;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.ide.common.sdk.SdkVersionInfo;
+import com.android.sdklib.SdkVersionInfo;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
index 60dd0f2..14f59c0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/NewProjectPage.java
@@ -21,7 +21,7 @@ import static com.android.ide.eclipse.adt.AdtUtils.extractClassName;
import static com.android.ide.eclipse.adt.internal.wizards.templates.NewTemplatePage.WIZARD_PAGE_WIDTH;
import com.android.annotations.Nullable;
-import com.android.ide.common.sdk.SdkVersionInfo;
+import com.android.sdklib.SdkVersionInfo;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.IconFactory;
@@ -551,8 +551,8 @@ public class NewProjectPage extends WizardPage
try {
minSdk = Integer.parseInt(mValues.minSdk);
} catch (NumberFormatException nufe) {
- // If not a number, then the string is a codename, so treat it
- // as a preview version.
+ // If not a number, then the string is a codename, so treat it
+ // as a preview version.
minSdk = SdkVersionInfo.HIGHEST_KNOWN_API + 1;
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
index e5fb3a3..09f4592 100644
--- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
+++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandlerTest.java
@@ -24,7 +24,7 @@ import static com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHan
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.ide.common.sdk.SdkVersionInfo;
+import com.android.sdklib.SdkVersionInfo;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.lint.EclipseLintClient;
diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp b/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp
index 0acb307..de28f8f 100644
--- a/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp
+++ b/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp
@@ -27,6 +27,7 @@
typedef std::set<RenderThread *> RenderThreadsSet;
RenderServer::RenderServer() :
+ m_lock(),
m_listenSock(NULL),
m_exiting(false)
{
@@ -102,7 +103,7 @@ int RenderServer::Main()
break;
}
- RenderThread *rt = RenderThread::create(stream);
+ RenderThread *rt = RenderThread::create(stream, &m_lock);
if (!rt) {
fprintf(stderr,"Failed to create RenderThread\n");
delete stream;
diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderServer.h b/emulator/opengl/host/libs/libOpenglRender/RenderServer.h
index 18b4442..ff63c94 100644
--- a/emulator/opengl/host/libs/libOpenglRender/RenderServer.h
+++ b/emulator/opengl/host/libs/libOpenglRender/RenderServer.h
@@ -17,6 +17,7 @@
#define _LIB_OPENGL_RENDER_RENDER_SERVER_H
#include "SocketStream.h"
+#include "emugl/common/mutex.h"
#include "osThread.h"
class RenderServer : public osUtils::Thread
@@ -33,6 +34,7 @@ private:
RenderServer();
private:
+ emugl::Mutex m_lock;
SocketStream *m_listenSock;
bool m_exiting;
};
diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp b/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp
index 9ae2a43..19d6c1f 100644
--- a/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp
+++ b/emulator/opengl/host/libs/libOpenglRender/RenderThread.cpp
@@ -25,9 +25,10 @@
#define STREAM_BUFFER_SIZE 4*1024*1024
-RenderThread::RenderThread() :
+RenderThread::RenderThread(IOStream *stream, emugl::Mutex *lock) :
osUtils::Thread(),
- m_stream(NULL),
+ m_lock(lock),
+ m_stream(stream),
m_finished(false)
{
}
@@ -37,16 +38,9 @@ RenderThread::~RenderThread()
delete m_stream;
}
-RenderThread *RenderThread::create(IOStream *p_stream)
+RenderThread *RenderThread::create(IOStream *p_stream, emugl::Mutex *lock)
{
- RenderThread *rt = new RenderThread();
- if (!rt) {
- return NULL;
- }
-
- rt->m_stream = p_stream;
-
- return rt;
+ return new RenderThread(p_stream, lock);
}
int RenderThread::Main()
@@ -113,6 +107,7 @@ int RenderThread::Main()
do {
progress = false;
+ m_lock->lock();
//
// try to process some of the command buffer using the GLESv1 decoder
//
@@ -141,6 +136,8 @@ int RenderThread::Main()
progress = true;
}
+ m_lock->unlock();
+
} while( progress );
}
diff --git a/emulator/opengl/host/libs/libOpenglRender/RenderThread.h b/emulator/opengl/host/libs/libOpenglRender/RenderThread.h
index 80a9aef..e94d782 100644
--- a/emulator/opengl/host/libs/libOpenglRender/RenderThread.h
+++ b/emulator/opengl/host/libs/libOpenglRender/RenderThread.h
@@ -19,20 +19,23 @@
#include "IOStream.h"
#include "GLDecoder.h"
#include "renderControl_dec.h"
+
+#include "emugl/common/mutex.h"
#include "osThread.h"
class RenderThread : public osUtils::Thread
{
public:
- static RenderThread *create(IOStream *p_stream);
+ static RenderThread* create(IOStream* p_stream, emugl::Mutex* mutex);
virtual ~RenderThread();
bool isFinished() const { return m_finished; }
private:
- RenderThread();
+ RenderThread(IOStream* p_stream, emugl::Mutex* mutex);
virtual int Main();
private:
+ emugl::Mutex *m_lock;
IOStream *m_stream;
renderControl_decoder_context_t m_rcDec;
bool m_finished;