dix: ensure work queues are cleared on reset
If the server resets, most client workqueues are cleaned up as the
clients are killed.
The one exception is the server's client, which is exempt from
the killing spree.
If that client has a queued work procedure active, it won't get
cleared on reset.
This commit ensures it gets cleared too.
(cherry picked from commit 8738ce85df
)
Fixes: xorg/xserver#670
This commit is contained in:
parent
94f036d412
commit
34553f5026
|
@ -507,6 +507,19 @@ InitBlockAndWakeupHandlers(void)
|
|||
WorkQueuePtr workQueue;
|
||||
static WorkQueuePtr *workQueueLast = &workQueue;
|
||||
|
||||
void
|
||||
ClearWorkQueue(void)
|
||||
{
|
||||
WorkQueuePtr q, *p;
|
||||
|
||||
p = &workQueue;
|
||||
while ((q = *p)) {
|
||||
*p = q->next;
|
||||
free(q);
|
||||
}
|
||||
workQueueLast = p;
|
||||
}
|
||||
|
||||
void
|
||||
ProcessWorkQueue(void)
|
||||
{
|
||||
|
|
|
@ -342,6 +342,8 @@ dix_main(int argc, char *argv[], char *envp[])
|
|||
|
||||
DeleteCallbackManager();
|
||||
|
||||
ClearWorkQueue();
|
||||
|
||||
if (dispatchException & DE_TERMINATE) {
|
||||
CloseWellKnownConnections();
|
||||
}
|
||||
|
|
|
@ -240,6 +240,8 @@ extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blo
|
|||
|
||||
extern _X_EXPORT void InitBlockAndWakeupHandlers(void);
|
||||
|
||||
extern _X_EXPORT void ClearWorkQueue(void);
|
||||
|
||||
extern _X_EXPORT void ProcessWorkQueue(void);
|
||||
|
||||
extern _X_EXPORT void ProcessWorkQueueZombies(void);
|
||||
|
|
Loading…
Reference in New Issue