~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/thr_lock.h

  • Committer: Brian Aker
  • Date: 2009-02-20 22:48:37 UTC
  • Revision ID: brian@tangent.org-20090220224837-fw5wrf46n4ru3e6a
First pass of stripping uint

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
 
 
74
 
extern ulong max_write_lock_count;
75
 
extern ulong table_lock_wait_timeout;
 
32
 
 
33
extern uint64_t max_write_lock_count;
 
34
extern uint64_t table_lock_wait_timeout;
76
35
extern bool thr_lock_inited;
77
36
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
78
37
 
109
68
  void *status_param;                   /* Param to status functions */
110
69
} THR_LOCK_DATA;
111
70
 
 
71
/* A helper type for transactional locking. */
 
72
struct st_table_lock_info
 
73
{
 
74
  enum thr_lock_type lock_type;
 
75
  int           lock_timeout;
 
76
  bool          lock_transactional;
 
77
};
 
78
 
112
79
struct st_lock_list {
113
80
  THR_LOCK_DATA *data,**last;
114
81
};