drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
usr0sess.cc
1/*****************************************************************************
2
3Copyright (C) 1996, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
25
26#include "usr0sess.h"
27
28#ifdef UNIV_NONINL
29#include "usr0sess.ic"
30#endif
31
32#include "trx0trx.h"
33
34/*********************************************************************/
37UNIV_INTERN
38sess_t*
40/*===========*/
41{
42 sess_t* sess;
43
44 ut_ad(mutex_own(&kernel_mutex));
45
46 sess = static_cast<sess_t *>(mem_alloc(sizeof(sess_t)));
47
48 sess->state = SESS_ACTIVE;
49
50 sess->trx = trx_create(sess);
51
52 UT_LIST_INIT(sess->graphs);
53
54 return(sess);
55}
56
57/*********************************************************************/
59UNIV_INTERN
60void
62/*=======*/
63 sess_t* sess)
64{
65 ut_ad(!mutex_own(&kernel_mutex));
66
67 ut_a(UT_LIST_GET_LEN(sess->graphs) == 0);
68
70 mem_free(sess);
71}
#define mem_free(PTR)
Definition mem0mem.h:243
ulint state
Definition usr0sess.h:57
trx_t * trx
Definition usr0sess.h:58
UNIV_INTERN void trx_free_for_background(trx_t *trx)
Definition trx0trx.cc:363
UNIV_INTERN trx_t * trx_create(sess_t *sess) __attribute__((nonnull))
Definition trx0trx.cc:90
UNIV_INTERN sess_t * sess_open(void)
Definition usr0sess.cc:39
UNIV_INTERN void sess_close(sess_t *sess)
Definition usr0sess.cc:61
#define ut_ad(EXPR)
Definition ut0dbg.h:127
#define ut_a(EXPR)
Definition ut0dbg.h:105
#define UT_LIST_GET_LEN(BASE)
Definition ut0lst.h:216
#define UT_LIST_INIT(BASE)
Definition ut0lst.h:83