Added spinlock ses_lock to struct SESSION to ensure that for each session closeSession is called only once.

closeSession is called from mysql_backend.c:gw_read_backend_event, and from dcb.c:dcb_close.

This is part of Bug #163.
This commit is contained in:
vraatikka
2013-08-22 10:42:18 +03:00
parent 4138281183
commit 0401290021
4 changed files with 56 additions and 15 deletions

View File

@ -33,6 +33,8 @@
* @endverbatim
*/
#include <time.h>
#include <atomic.h>
#include <spinlock.h>
struct dcb;
struct service;
@ -52,6 +54,7 @@ typedef struct {
* and originating service together for the client session.
*/
typedef struct session {
SPINLOCK ses_lock;
int state; /**< Current descriptor state */
struct dcb *client; /**< The client connection */
struct dcb *backends; /**< The set of backend servers */