1
/*****************************************************************************
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
17
*****************************************************************************/
19
/**************************************************//**
23
Created 6/25/1996 Heikki Tuuri
24
*******************************************************/
29
#include "usr0sess.ic"
34
/*********************************************************************//**
36
@return own: session object */
44
ut_ad(mutex_own(&kernel_mutex));
46
sess = mem_alloc(sizeof(sess_t));
48
sess->state = SESS_ACTIVE;
50
sess->trx = trx_create(sess);
52
UT_LIST_INIT(sess->graphs);
57
/*********************************************************************//**
58
Closes a session, freeing the memory occupied by it. */
63
sess_t* sess) /*!< in, own: session object */
65
ut_ad(!mutex_own(&kernel_mutex));
67
ut_a(UT_LIST_GET_LEN(sess->graphs) == 0);
69
trx_free_for_background(sess->trx);