mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
egl: Add a mutex to _EGLDisplay.
A display may be shared by multiple threads. Add a mutex for access control.
This commit is contained in:
parent
b3bb180620
commit
99bcb1f06d
2 changed files with 4 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ _eglNewDisplay(EGLNativeDisplayType nativeDisplay)
|
|||
{
|
||||
_EGLDisplay *dpy = (_EGLDisplay *) calloc(1, sizeof(_EGLDisplay));
|
||||
if (dpy) {
|
||||
_eglInitMutex(&dpy->Mutex);
|
||||
dpy->NativeDisplay = nativeDisplay;
|
||||
}
|
||||
return dpy;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "egltypedefs.h"
|
||||
#include "egldefines.h"
|
||||
#include "eglmutex.h"
|
||||
|
||||
|
||||
enum _egl_resource_type {
|
||||
|
|
@ -53,6 +54,8 @@ struct _egl_display
|
|||
/* used to link displays */
|
||||
_EGLDisplay *Next;
|
||||
|
||||
_EGLMutex Mutex;
|
||||
|
||||
EGLNativeDisplayType NativeDisplay;
|
||||
|
||||
EGLBoolean Initialized; /**< True if the display is initialized */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue