Switch bitmask_clear to be locking and offer bitmask_clear_without_spinlock for non-locking version, in response to review comments. Revert poll.c to use bitmask_clear (with locking) and amend dcb.c to use the non-locking version and to take advantage of the return of an indication of whether the whole bitmask is then clearn.

This commit is contained in:
counterpoint
2016-01-08 12:19:29 +00:00
parent 4461cd9398
commit fb5fdb17db
4 changed files with 9 additions and 11 deletions

View File

@ -489,9 +489,7 @@ dcb_process_zombies(int threadid)
else
{
bitmask_clear(&zombiedcb->memdata.bitmask, threadid);
if (bitmask_isallclear(&zombiedcb->memdata.bitmask))
if (bitmask_clear_without_spinlock(&zombiedcb->memdata.bitmask))
{
/**
* Remove the DCB from the zombie queue
@ -1736,7 +1734,7 @@ dcb_drain_writeq_SSL(DCB *dcb)
return n;
}
/**
/**
* Removes dcb from poll set, and adds it to zombies list. As a consequence,
* dcb first moves to DCB_STATE_NOPOLLING, and then to DCB_STATE_ZOMBIE state.
* At the end of the function state may not be DCB_STATE_ZOMBIE because once