This commit is contained in:
vraatikka 2013-09-09 00:05:28 +03:00
commit 27338c2537

View File

@ -161,7 +161,7 @@ dcb_add_to_zombieslist(DCB *dcb)
if (dcb->state == DCB_STATE_ZOMBIE)
{
ss_dassert(zombies != NULL);
spinlock_release(&zombiespin);
spinlock_release(&zombiespin);
return;
}
@ -250,7 +250,8 @@ void* rsession = NULL;
/**
* Terminate router session.
*/
service = dcb->session->service;
if (dcb->session)
service = dcb->session->service;
if (service != NULL &&
service->router != NULL &&
@ -313,6 +314,16 @@ DCB* dcb_list = NULL;
DCB* dcb = NULL;
bool succp = false;
/*
* Perform a dirty read to see if there is anything in the queue.
* This avoids threads hitting the queue spinlock when the queue
* is empty. This will really help when the only entry is being
* freed, since the queue is updated before the expensive call to
* dcb_final_free.
*/
if (!zombies)
return;
spinlock_acquire(&zombiespin);
ptr = zombies;
lptr = NULL;