~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/lock/lock0lock.c

  • Committer: Brian Aker
  • Date: 2009-03-17 04:26:36 UTC
  • mfrom: (933.1.4 innodb-plugin-merge)
  • Revision ID: brian@tangent.org-20090317042636-oyd238h2u2bqhfy1
Merging new Innodb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
 
4
 
 
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.
 
8
 
 
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.
 
12
 
 
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., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
 
16
 
 
17
*****************************************************************************/
 
18
 
1
19
/******************************************************
2
20
The transaction lock system
3
21
 
4
 
(c) 1996 Innobase Oy
5
 
 
6
22
Created 5/7/1996 Heikki Tuuri
7
23
*******************************************************/
8
24
 
699
715
        const lock_t*   lock;
700
716
        ibool           ok      = FALSE;
701
717
 
702
 
        ut_ad(table && trx);
 
718
        ut_ad(table);
 
719
        ut_ad(trx);
 
720
 
 
721
        lock_mutex_enter_kernel();
703
722
 
704
723
        for (lock = UT_LIST_GET_FIRST(table->locks);
705
724
             lock;
707
726
                if (lock->trx != trx) {
708
727
                        /* A lock on the table is held
709
728
                        by some other transaction. */
710
 
                        return(FALSE);
 
729
                        goto not_ok;
711
730
                }
712
731
 
713
732
                if (!(lock_get_type_low(lock) & LOCK_TABLE)) {
724
743
                        auto_increment lock. */
725
744
                        break;
726
745
                default:
 
746
not_ok:
727
747
                        /* Other table locks than LOCK_IX are not allowed. */
728
 
                        return(FALSE);
 
748
                        ok = FALSE;
 
749
                        goto func_exit;
729
750
                }
730
751
        }
731
752
 
 
753
func_exit:
 
754
        lock_mutex_exit_kernel();
 
755
 
732
756
        return(ok);
733
757
}
734
758
 
3834
3858
        dict_table_t*   table;
3835
3859
        lock_t*         lock;
3836
3860
 
 
3861
        ut_ad(mutex_own(&kernel_mutex));
3837
3862
        ut_ad(lock_get_wait(wait_lock));
3838
3863
 
3839
3864
        table = wait_lock->un_member.tab_lock.table;