~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/usr/usr0sess.c

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2010-10-20 20:41:00 UTC
  • mfrom: (1863 staging)
  • mto: This revision was merged to the branch mainline in revision 1871.
  • Revision ID: barry.leslie@primebase.com-20101020204100-oyj6p5cfssjw3p62
Merged with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "trx0trx.h"
33
33
 
34
34
/*********************************************************************//**
35
 
Closes a session, freeing the memory occupied by it. */
36
 
static
37
 
void
38
 
sess_close(
39
 
/*=======*/
40
 
        sess_t*         sess);  /*!< in, own: session object */
41
 
 
42
 
/*********************************************************************//**
43
35
Opens a session.
44
36
@return own: session object */
45
37
UNIV_INTERN
64
56
 
65
57
/*********************************************************************//**
66
58
Closes a session, freeing the memory occupied by it. */
67
 
static
 
59
UNIV_INTERN
68
60
void
69
61
sess_close(
70
62
/*=======*/
71
63
        sess_t* sess)   /*!< in, own: session object */
72
64
{
73
 
        ut_ad(mutex_own(&kernel_mutex));
74
 
        ut_ad(sess->trx == NULL);
75
 
 
 
65
        ut_ad(!mutex_own(&kernel_mutex));
 
66
 
 
67
        ut_a(UT_LIST_GET_LEN(sess->graphs) == 0);
 
68
 
 
69
        trx_free_for_background(sess->trx);
76
70
        mem_free(sess);
77
71
}
78
 
 
79
 
/*********************************************************************//**
80
 
Closes a session, freeing the memory occupied by it, if it is in a state
81
 
where it should be closed.
82
 
@return TRUE if closed */
83
 
UNIV_INTERN
84
 
ibool
85
 
sess_try_close(
86
 
/*===========*/
87
 
        sess_t* sess)   /*!< in, own: session object */
88
 
{
89
 
        ut_ad(mutex_own(&kernel_mutex));
90
 
 
91
 
        if (UT_LIST_GET_LEN(sess->graphs) == 0) {
92
 
                sess_close(sess);
93
 
 
94
 
                return(TRUE);
95
 
        }
96
 
 
97
 
        return(FALSE);
98
 
}