diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-07-16 20:52:25 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2005-07-16 20:52:25 +0000 |
commit | ead37b08699f665a856c7ba29578c27c27db4100 (patch) | |
tree | 6470cbacdc7ba899039e68093f2746aba13b3a5c /dix/dispatch.c | |
parent | bbb49449cbc0815fd9c4faf9b6ee32be99a8aa3d (diff) |
Mark variables modified in signal handlers as volatile (part of Sun bug id
Diffstat (limited to 'dix/dispatch.c')
-rw-r--r-- | dix/dispatch.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c index 0fed6a0e7..99103ae65 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -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. |