~drizzle-trunk/drizzle/development

520.6.4 by Monty Taylor
Moved thr_lock.h out of common_includes.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; version 2 of the License.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
19
20
/**
21
 * @file
22
 *
23
 * Mostly constants and enums used by mysys
24
 */
25
26
#ifndef MYSYS_DEFINITIONS_H
27
#define MYSYS_DEFINITIONS_H
28
29
enum thr_lock_type { TL_IGNORE=-1,
30
                     /* UNLOCK ANY LOCK */
31
                     TL_UNLOCK,
32
                     /* Read lock */
33
                     TL_READ,
34
                     TL_READ_WITH_SHARED_LOCKS,
35
                     /* High prior. than TL_WRITE. Allow concurrent insert */
36
                     TL_READ_HIGH_PRIORITY,
37
                     /* READ, Don't allow concurrent insert */
38
                     TL_READ_NO_INSERT,
39
                     /*
40
                       Write lock, but allow other threads to read / write.
41
                       Used by BDB tables in MySQL to mark that someone is
42
                       reading/writing to the table.
43
                     */
44
                     TL_WRITE_ALLOW_WRITE,
45
                     /*
46
                       Write lock, but allow other threads to read.
47
                       Used by ALTER TABLE in MySQL to allow readers
48
                       to use the table until ALTER TABLE is finished.
49
                     */
50
                     TL_WRITE_ALLOW_READ,
51
                     /*
52
                       WRITE lock used by concurrent insert. Will allow
53
                       READ, if one could use concurrent insert on table.
54
                     */
55
                     TL_WRITE_CONCURRENT_INSERT,
56
                     /* Write used by INSERT DELAYED.  Allows READ locks */
57
                     TL_WRITE_DELAYED,
58
                     /*
59
                       parser only! Late bound low_priority flag.
60
                       At open_tables() becomes thd->update_lock_default.
61
                     */
62
                     TL_WRITE_DEFAULT,
63
                     /* WRITE lock that has lower priority than TL_READ */
64
                     TL_WRITE_LOW_PRIORITY,
65
                     /* Normal WRITE lock */
66
                     TL_WRITE,
67
                     /* Abort new lock request with an error */
68
                     TL_WRITE_ONLY};
69
70
enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
71
                            THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 };
72
73
74
#endif /* MYSYS_DEFINITIONS_H */