24
24
#include <mysys/my_pthread.h>
25
25
#include <mysys/my_list.h>
26
#include <mysys/definitions.h>
27
28
struct st_thr_lock;
28
29
extern uint32_t locks_immediate,locks_waited ;
29
30
extern pthread_mutex_t THR_LOCK_lock;
31
enum thr_lock_type { TL_IGNORE=-1,
32
TL_UNLOCK, /* UNLOCK ANY LOCK */
33
TL_READ, /* Read lock */
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
33
extern ulong max_write_lock_count;
75
34
extern ulong table_lock_wait_timeout;