From 7b8497df7aa46d4536b2529ba1233dd1711f588a Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Wed, 30 Nov 2016 09:00:31 +0200 Subject: [PATCH] Make sure listener DCBs are removed cleanly from the list As listener DCBs can be added and removed from the polling system multiple times, the DCBs need to be reset to a clean state when they are removed. --- server/core/dcb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/core/dcb.c b/server/core/dcb.c index b0f3ceb6a..8589315fb 100644 --- a/server/core/dcb.c +++ b/server/core/dcb.c @@ -3471,6 +3471,11 @@ static void dcb_remove_from_list(DCB *dcb) } } + /** Reset the next and tail pointers so that if this DCB is added to the list + * again, it will be in a clean state. */ + dcb->thread.next = NULL; + dcb->thread.tail = NULL; + spinlock_release(&all_dcbs_lock[dcb->thread.id]); }