Add mapping function for DCBs
The dcb_foreach allows a function to be mapped to all DCBs in MaxScale. This allows the list of DCBs to be iterated in a safe manner without having to worry about internal locking of the DCB mechanism.
This commit is contained in:
@ -380,6 +380,17 @@ void dcb_append_readqueue(DCB *dcb, GWBUF *buffer);
|
||||
void dcb_enable_session_timeouts();
|
||||
void dcb_process_idle_sessions(int thr);
|
||||
|
||||
/**
|
||||
* @brief Call a function for each connected DCB
|
||||
*
|
||||
* @param func Function to call. The function should return @c true to continue iteration
|
||||
* and @c false to stop iteration earlier. The first parameter is a DCB and the second
|
||||
* is the value of @c data that the user provided.
|
||||
* @param data User provided data passed as the second parameter to @c func
|
||||
* @return True if all DCBs were iterated, false if the callback returned false
|
||||
*/
|
||||
bool dcb_foreach(bool (*func)(DCB *, void *), void *data);
|
||||
|
||||
/**
|
||||
* DCB flags values
|
||||
*/
|
||||
|
Reference in New Issue
Block a user