Mark variables modified in signal handlers as volatile (part of Sun bug id
4496504)
This commit is contained in:
parent
bbb49449cb
commit
ead37b0869
|
@ -157,8 +157,14 @@ static int nextFreeClientID; /* always MIN free client ID */
|
|||
static int nClients; /* number of authorized clients */
|
||||
|
||||
CallbackListPtr ClientStateCallback;
|
||||
char dispatchException = 0;
|
||||
char isItTimeToYield;
|
||||
|
||||
/* dispatchException & isItTimeToYield must be declared volatile since they
|
||||
* are modified by signal handlers - otherwise optimizer may assume it doesn't
|
||||
* need to actually check value in memory when used and may miss changes from
|
||||
* signal handlers.
|
||||
*/
|
||||
volatile char dispatchException = 0;
|
||||
volatile char isItTimeToYield;
|
||||
|
||||
/* Various of the DIX function interfaces were not designed to allow
|
||||
* the client->errorValue to be set on BadValue and other errors.
|
||||
|
|
|
@ -42,8 +42,8 @@ from The Open Group.
|
|||
extern char *defaultTextFont;
|
||||
extern char *defaultCursorFont;
|
||||
extern int MaxClients;
|
||||
extern char isItTimeToYield;
|
||||
extern char dispatchException;
|
||||
extern volatile char isItTimeToYield;
|
||||
extern volatile char dispatchException;
|
||||
|
||||
/* bit values for dispatchException */
|
||||
#define DE_RESET 1
|
||||
|
|
Loading…
Reference in New Issue