~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/thr_lock.h

  • Committer: Monty Taylor
  • Date: 2008-10-29 14:15:34 UTC
  • mto: (520.4.26 devel)
  • mto: This revision was merged to the branch mainline in revision 570.
  • Revision ID: monty@inaugust.com-20081029141534-jyfurnz6dcwa7opc
Moved thr_lock.h out of common_includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <mysys/my_pthread.h>
25
25
#include <mysys/my_list.h>
 
26
#include <mysys/definitions.h>
26
27
 
27
28
struct st_thr_lock;
28
29
extern uint32_t locks_immediate,locks_waited ;
29
30
extern pthread_mutex_t THR_LOCK_lock;
30
31
 
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 */
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
32
 
74
33
extern ulong max_write_lock_count;
75
34
extern ulong table_lock_wait_timeout;