Add dcb functions

dcb_readq_append()
dcb_readq_prepend()
dcb_readq_set()
dcb_readq_has()
dcb_readq_release()
dcb_readq_get()
dcb_readq_length()

No code but for DCB code itself should directly manipulate the
internals of a DCB. Thesse functions will be taken into use in
protocol modules.
This commit is contained in:
Johan Wikman
2017-09-06 10:08:05 +03:00
parent 186ee31abf
commit 24044a7376
2 changed files with 96 additions and 17 deletions

View File

@ -2714,21 +2714,6 @@ dcb_role_name(DCB *dcb)
return name;
}
/**
* @brief Append a buffer the DCB's readqueue
*
* Usually data is stored into the DCB's readqueue when not enough data is
* available and the processing needs to be deferred until more data is available.
*
* @param dcb DCB where the buffer is stored
* @param buffer Buffer to store
*/
void dcb_append_readqueue(DCB *dcb, GWBUF *buffer)
{
dcb->dcb_readqueue = gwbuf_append(dcb->dcb_readqueue, buffer);
}
static void dcb_add_to_worker_list(int thread_id, void* data)
{
DCB *dcb = (DCB*)data;