Added spinlock protection for the session association to the DCB and

reworked the reference count mechanism on the session.  Introduced a
FREE state for the session and alter the session destruction flow so
that we only remove the session when all the DCB's have singled they
have finished processing events for the DCB rather than when the first
thread decides to clsoe the DCB.
This commit is contained in:
Mark Riddoch
2013-09-04 12:24:59 +02:00
parent 8debc4433c
commit f74f67540f
5 changed files with 76 additions and 43 deletions

View File

@ -588,7 +588,6 @@ int gw_read_client_event(DCB* dcb) {
//write to client mysql AUTH_OK packet, packet n. is 2
// start a new session, and connect to backends
session = session_alloc(dcb->service, dcb);
atomic_add(&dcb->session->refcount, 1);
CHK_SESSION(session);
ss_dassert(session->state != SESSION_STATE_ALLOC);
protocol->state = MYSQL_IDLE;