MXS-1392 Manage DCB lifetime using refcounts

Now it is also possible to ensure that a DCB stays alive while
a task referring to it is posted from one worker to another.
That will be implemented in a subsequent commit.
This commit is contained in:
Johan Wikman
2017-09-07 16:59:37 +03:00
parent bf42d845cf
commit be94066b77
6 changed files with 102 additions and 16 deletions

View File

@ -37,6 +37,7 @@
#include <maxscale/utils.h>
#include <maxscale/json_api.h>
#include "maxscale/dcb.h"
#include "maxscale/session.h"
#include "maxscale/filter.h"
#include "maxscale/worker.hh"
@ -392,7 +393,8 @@ static void session_free(MXS_SESSION *session)
if (session->client_dcb)
{
dcb_free_all_memory(session->client_dcb);
dcb_dec_ref(session->client_dcb);
session->client_dcb = NULL;
}
/**
* If session is not child of some other session, free router_session.