fix recurseve mutex on Android
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
//BEGIN_INCLUDE(all)
|
||||
#include <mutex>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <jni.h>
|
||||
@@ -51,6 +52,7 @@ typedef void (*fnDebugMessageCallback)(GLDEBUGPROC callback, const void* userPar
|
||||
|
||||
EGLDisplay g_display = EGL_NO_DISPLAY;
|
||||
EGLContext g_context = EGL_NO_CONTEXT;
|
||||
std::recursive_mutex mutex;
|
||||
|
||||
jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
|
||||
{
|
||||
@@ -124,7 +126,7 @@ int GetUnicodeChar(struct android_app* app, int eventType, int keyCode, int meta
|
||||
|
||||
void android_async_lock(struct engine* engine)
|
||||
{
|
||||
pthread_mutex_lock(&engine->app->mutex);
|
||||
mutex.lock();
|
||||
eglMakeCurrent(engine->display, engine->surface, engine->surface, engine->context);
|
||||
}
|
||||
|
||||
@@ -136,7 +138,7 @@ void android_async_swap(struct engine* engine)
|
||||
void android_async_unlock(struct engine* engine)
|
||||
{
|
||||
eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
pthread_mutex_unlock(&engine->app->mutex);
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
struct locker
|
||||
|
||||
Reference in New Issue
Block a user