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

@ -53,7 +53,8 @@ typedef enum {
SESSION_STATE_ALLOC,
SESSION_STATE_READY,
SESSION_STATE_LISTENER,
SESSION_STATE_LISTENER_STOPPED
SESSION_STATE_LISTENER_STOPPED,
SESSION_STATE_FREE
} session_state_t;
/**
@ -87,4 +88,5 @@ extern void printSession(SESSION *);
extern void dprintAllSessions(struct dcb *);
extern void dprintSession(struct dcb *, SESSION *);
extern char *session_state(int);
extern bool session_link_dcb(SESSION *, struct dcb *);
#endif