Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion host/gl/glestranslator/egl/egl_surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "egl_display.h"
#include "egl_os_api.h"

unsigned int EglSurface::s_nextSurfaceHndl = 0;
std::atomic<unsigned int> EglSurface::s_nextSurfaceHndl{0};

EglSurface::~EglSurface(){

Expand Down
5 changes: 4 additions & 1 deletion host/gl/glestranslator/egl/egl_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <EGL/egl.h>
#include <GLES2/gl2.h>

#include <atomic>
#include <memory>

class EglSurface;
Expand Down Expand Up @@ -60,7 +61,9 @@ class EglSurface {
GLuint glRboDepth = 0;

private:
static unsigned int s_nextSurfaceHndl;
// Atomic: eglCreatePbufferSurface() constructs surfaces before it takes
// graphicsDriverLock(), so two threads can increment it at the same time.
static std::atomic<unsigned int> s_nextSurfaceHndl;

ESurfaceType m_type = WINDOW;
unsigned int m_hndl = 0;
Expand Down
Loading