diff options
author | Jesse Hall <jessehall@google.com> | 2012-01-11 10:49:55 -0800 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-01-11 10:49:55 -0800 |
commit | 7851751670aa7b6e4cb153ea7c16185f8759cc4e (patch) | |
tree | c9f6989240439e14dc0b808cc73750df7556a14e | |
parent | 762d5decf0eaa766e69ecd94f4349be53dedd767 (diff) | |
download | external_qemu-7851751670aa7b6e4cb153ea7c16185f8759cc4e.zip external_qemu-7851751670aa7b6e4cb153ea7c16185f8759cc4e.tar.gz external_qemu-7851751670aa7b6e4cb153ea7c16185f8759cc4e.tar.bz2 |
SDL: Call XInitThreads() after loading Xlib
XInitThreads() enables thread-safety in Xlib, so multiple threads can
safely call into it concurrently. This happens with GLES passthrough
enabled: the GLES system serializes its own Xlib and GLX calls, but
there is no serialization between the GLES system and the SDL code
running the main UI.
This call must be the first Xlib call, so I put it here in the loading
code rather than the multiple places that call XOpenDisplay().
Change-Id: I3cd3177fb8e0904a803a6b5c8f89a4ecda73bd1c
-rw-r--r-- | distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c | 1 | ||||
-rw-r--r-- | distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c b/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c index 883c235..7b99d73 100644 --- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c +++ b/distrib/sdl-1.2.12/src/video/x11/SDL_x11dyn.c @@ -170,6 +170,7 @@ int SDL_X11_LoadSymbols(void) if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */ SDL_ClearError(); + XInitThreads(); } else { SDL_X11_UnloadSymbols(); /* in case something got loaded... */ rc = 0; diff --git a/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h b/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h index c4df1f6..b8d90e4 100644 --- a/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h +++ b/distrib/sdl-1.2.12/src/video/x11/SDL_x11sym.h @@ -70,6 +70,7 @@ SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* SDL_X11_SYM(int,XGrabKeyboard,(Display* a,Window b,Bool c,int d,int e,Time f),(a,b,c,d,e,f),return) SDL_X11_SYM(int,XGrabPointer,(Display* a,Window b,Bool c,unsigned int d,int e,int f,Window g,Cursor h,Time i),(a,b,c,d,e,f,g,h,i),return) SDL_X11_SYM(Status,XIconifyWindow,(Display* a,Window b,int c),(a,b,c),return) +SDL_X11_SYM(Status,XInitThreads,(void),(),return) SDL_X11_SYM(int,XInstallColormap,(Display* a,Colormap b),(a,b),return) SDL_X11_SYM(KeyCode,XKeysymToKeycode,(Display* a,KeySym b),(a,b),return) SDL_X11_SYM(Atom,XInternAtom,(Display* a,_Xconst char* b,Bool c),(a,b,c),return) |