~thomir-deactivatedaccount/drizzle/drizzle-fix-bug653747

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-10-10 02:07:52 UTC
  • mfrom: (1827.2.3 staging)
  • Revision ID: brian@tangent.org-20101010020752-ktv73isay5dxtvp3
Merge in switch on table_share_instance inheritance.

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
/*********************************************************************//**
35
43
Opens a session.
36
44
@return own: session object */
37
45
UNIV_INTERN
56
64
 
57
65
/*********************************************************************//**
58
66
Closes a session, freeing the memory occupied by it. */
59
 
UNIV_INTERN
 
67
static
60
68
void
61
69
sess_close(
62
70
/*=======*/
63
71
        sess_t* sess)   /*!< in, own: session object */
64
72
{
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);
 
73
        ut_ad(mutex_own(&kernel_mutex));
 
74
        ut_ad(sess->trx == NULL);
 
75
 
70
76
        mem_free(sess);
71
77
}
 
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
}