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.
This commit is contained in:
parent
364d649815
commit
8738ce85df
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -340,6 +340,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
Block a user