~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/lock0priv.h

  • Committer: Monty Taylor
  • Date: 2009-08-12 06:25:19 UTC
  • mto: (1114.1.1 innodb-plugin-merge)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090812062519-cij02mrrunvnxblt
Tags: innodb-plugin-1.0.4
InnoDB Plugin 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/******************************************************
 
19
/**************************************************//**
 
20
@file include/lock0priv.h
20
21
Lock module internal structures and methods.
21
22
 
22
23
Created July 12, 2007 Vasil Dimov
38
39
#include "trx0types.h"
39
40
#include "ut0lst.h"
40
41
 
41
 
/* A table lock */
 
42
/** A table lock */
42
43
typedef struct lock_table_struct        lock_table_t;
 
44
/** A table lock */
43
45
struct lock_table_struct {
44
 
        dict_table_t*   table;          /* database table in dictionary
 
46
        dict_table_t*   table;          /*!< database table in dictionary
45
47
                                        cache */
46
48
        UT_LIST_NODE_T(lock_t)
47
 
                        locks;          /* list of locks on the same
 
49
                        locks;          /*!< list of locks on the same
48
50
                                        table */
49
51
};
50
52
 
51
 
/* Record lock for a page */
 
53
/** Record lock for a page */
52
54
typedef struct lock_rec_struct          lock_rec_t;
 
55
/** Record lock for a page */
53
56
struct lock_rec_struct {
54
 
        ulint   space;                  /* space id */
55
 
        ulint   page_no;                /* page number */
56
 
        ulint   n_bits;                 /* number of bits in the lock
 
57
        ulint   space;                  /*!< space id */
 
58
        ulint   page_no;                /*!< page number */
 
59
        ulint   n_bits;                 /*!< number of bits in the lock
57
60
                                        bitmap; NOTE: the lock bitmap is
58
61
                                        placed immediately after the
59
62
                                        lock struct */
60
63
};
61
64
 
62
 
/* Lock struct */
 
65
/** Lock struct */
63
66
struct lock_struct {
64
 
        trx_t*          trx;            /* transaction owning the
 
67
        trx_t*          trx;            /*!< transaction owning the
65
68
                                        lock */
66
69
        UT_LIST_NODE_T(lock_t)
67
 
                        trx_locks;      /* list of the locks of the
 
70
                        trx_locks;      /*!< list of the locks of the
68
71
                                        transaction */
69
 
        ulint           type_mode;      /* lock type, mode, LOCK_GAP or
 
72
        ulint           type_mode;      /*!< lock type, mode, LOCK_GAP or
70
73
                                        LOCK_REC_NOT_GAP,
71
74
                                        LOCK_INSERT_INTENTION,
72
75
                                        wait flag, ORed */
73
 
        hash_node_t     hash;           /* hash chain node for a record
 
76
        hash_node_t     hash;           /*!< hash chain node for a record
74
77
                                        lock */
75
 
        dict_index_t*   index;          /* index for a record lock */
 
78
        dict_index_t*   index;          /*!< index for a record lock */
76
79
        union {
77
 
                lock_table_t    tab_lock;/* table lock */
78
 
                lock_rec_t      rec_lock;/* record lock */
79
 
        } un_member;
 
80
                lock_table_t    tab_lock;/*!< table lock */
 
81
                lock_rec_t      rec_lock;/*!< record lock */
 
82
        } un_member;                    /*!< lock details */
80
83
};
81
84
 
82
 
/*************************************************************************
83
 
Gets the type of a lock. */
 
85
/*********************************************************************//**
 
86
Gets the type of a lock.
 
87
@return LOCK_TABLE or LOCK_REC */
84
88
UNIV_INLINE
85
89
ulint
86
90
lock_get_type_low(
87
91
/*==============*/
88
 
                                /* out: LOCK_TABLE or LOCK_REC */
89
 
        const lock_t*   lock);  /* in: lock */
90
 
 
91
 
/*************************************************************************
92
 
Gets the previous record lock set on a record. */
93
 
 
 
92
        const lock_t*   lock);  /*!< in: lock */
 
93
 
 
94
/*********************************************************************//**
 
95
Gets the previous record lock set on a record.
 
96
@return previous lock on the same record, NULL if none exists */
 
97
UNIV_INTERN
94
98
const lock_t*
95
99
lock_rec_get_prev(
96
100
/*==============*/
97
 
                                /* out: previous lock on the same
98
 
                                record, NULL if none exists */
99
 
        const lock_t*   in_lock,/* in: record lock */
100
 
        ulint           heap_no);/* in: heap number of the record */
 
101
        const lock_t*   in_lock,/*!< in: record lock */
 
102
        ulint           heap_no);/*!< in: heap number of the record */
101
103
 
102
104
#ifndef UNIV_NONINL
103
105
#include "lock0priv.ic"