mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 05:50:04 +01:00
Fixing following kind of race-conditions -
WaitForSomething()
|
----> // timers -> timer-1 -> timer-2 -> null
while (timers && (int) (timers->expires - now) <= 0)
// prototype - DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
DoTimer(timers, now, &timers)
|
|
----> OsBlockSignals(); .... OS Signal comes just before blocking it,
.... timer-1 handler gets called.
// timer-1 gets served and scheduled again;
// timers -> timer-2 -> timer-1 -> null
....
*prev = timer->next;
timer->next = NULL; // timers -> null
// timers list gets corrupted here and timer-2 gets removed from list.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86288
Signed-off-by: Nikhil Mahale <nmahale@nvidia.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
v2: Apply warning fixes from Keith Packard <keithp@keithp.com>
Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| access.c | ||
| auth.c | ||
| backtrace.c | ||
| busfault.c | ||
| client.c | ||
| connection.c | ||
| io.c | ||
| log.c | ||
| Makefile.am | ||
| mitauth.c | ||
| oscolor.c | ||
| osdep.h | ||
| osinit.c | ||
| rpcauth.c | ||
| strcasecmp.c | ||
| strcasestr.c | ||
| strlcat.c | ||
| strlcpy.c | ||
| strndup.c | ||
| utils.c | ||
| WaitFor.c | ||
| xdmauth.c | ||
| xdmcp.c | ||
| xprintf.c | ||
| xsha1.c | ||
| xstrans.c | ||