From 9bad8309ef289bb943651abf6967b24fa2252aac Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 20 Feb 2009 14:45:54 -0800 Subject: [PATCH] flags member of Display structure needs to be marked volatile Since the Xlib multithreaded code checks the flags variable in _XFlushInt to see if the other threads are done yet, it has to be marked volatile so the compiler doesn't optimize out re-loading it on each trip through the while loop and end up in an impossible-to-exit infinite loop of CPU chewing. Part of fix for Sun bug 6409332: infinite loop in XFlushInt() on x86/32-bit Signed-off-by: Alan Coopersmith --- include/X11/Xlibint.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/X11/Xlibint.h b/include/X11/Xlibint.h index c9c12f5a..4f3755fa 100644 --- a/include/X11/Xlibint.h +++ b/include/X11/Xlibint.h @@ -108,7 +108,7 @@ struct _XDisplay int nscreens; /* number of screens on this server*/ Screen *screens; /* pointer to list of screens */ unsigned long motion_buffer; /* size of motion buffer */ - unsigned long flags; /* internal connection flags */ + volatile unsigned long flags; /* internal connection flags */ int min_keycode; /* minimum defined keycode */ int max_keycode; /* maximum defined keycode */ KeySym *keysyms; /* This server's keysyms */