1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
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.
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.
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
23
* Mostly constants and enums used by mysys
26
#ifndef MYSYS_DEFINITIONS_H
27
#define MYSYS_DEFINITIONS_H
29
enum thr_lock_type { TL_IGNORE=-1,
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 */
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.
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.
52
WRITE lock used by concurrent insert. Will allow
53
READ, if one could use concurrent insert on table.
55
TL_WRITE_CONCURRENT_INSERT,
56
/* Write used by INSERT DELAYED. Allows READ locks */
59
parser only! Late bound low_priority flag.
60
At open_tables() becomes thd->update_lock_default.
63
/* WRITE lock that has lower priority than TL_READ */
64
TL_WRITE_LOW_PRIORITY,
65
/* Normal WRITE lock */
67
/* Abort new lock request with an error */
70
enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1,
71
THR_LOCK_WAIT_TIMEOUT= 2, THR_LOCK_DEADLOCK= 3 };
74
#endif /* MYSYS_DEFINITIONS_H */