MXS-1378 Provide access to the current DCB

This will be used by a subsequent `session_get_current()` and
`session_get_current_id()` for obtaining the current SESSION and
session id, respectively. The latter of those will be used by the
logging mechanism for logging the session id in conjunction with
messages.
This commit is contained in:
Johan Wikman
2017-08-30 10:27:57 +03:00
parent 5455ffbb7f
commit 67efd1daea
2 changed files with 61 additions and 35 deletions

View File

@ -293,6 +293,14 @@ void dcb_foreach_parallel(bool (*func)(DCB *dcb, void *data), void **data);
*/
int dcb_get_port(const DCB *dcb);
/**
* @brief Return the DCB currently being handled by the calling thread.
*
* @return A DCB, or NULL if the calling thread is not currently handling
* a DCB or if the calling thread is not a polling/worker thread.
*/
DCB* dcb_get_current();
/**
* DCB flags values
*/