~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to include/thr_lock.h

Removed/replaced DBUG symbols and standardized TRUE/FALSE

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
extern "C" {
22
22
#endif
23
23
 
24
 
#include <mysys/my_pthread.h>
25
 
#include <mysys/my_list.h>
 
24
#include <my_pthread.h>
 
25
#include <my_list.h>
26
26
 
27
27
struct st_thr_lock;
28
 
extern uint32_t locks_immediate,locks_waited ;
 
28
extern ulong locks_immediate,locks_waited ;
29
29
extern pthread_mutex_t THR_LOCK_lock;
30
30
 
31
31
enum thr_lock_type { TL_IGNORE=-1,
73
73
 
74
74
extern ulong max_write_lock_count;
75
75
extern ulong table_lock_wait_timeout;
76
 
extern bool thr_lock_inited;
 
76
extern my_bool thr_lock_inited;
77
77
extern enum thr_lock_type thr_upgraded_concurrent_insert_lock;
78
78
 
79
79
/*
85
85
{
86
86
  pthread_t thread;
87
87
  my_thread_id thread_id;
88
 
  uint32_t n_cursors;
 
88
  ulong n_cursors;
89
89
} THR_LOCK_INFO;
90
90
 
91
91
/*
107
107
  pthread_cond_t *cond;
108
108
  enum thr_lock_type type;
109
109
  void *status_param;                   /* Param to status functions */
 
110
  void *debug_print_param;
110
111
} THR_LOCK_DATA;
111
112
 
112
113
struct st_lock_list {
121
122
  struct st_lock_list write_wait;
122
123
  struct st_lock_list write;
123
124
  /* write_lock_count is incremented for write locks and reset on read locks */
124
 
  uint32_t write_lock_count;
125
 
  uint32_t read_no_write_count;
 
125
  ulong write_lock_count;
 
126
  uint read_no_write_count;
126
127
  void (*get_status)(void*, int);       /* When one gets a lock */
127
128
  void (*copy_status)(void*,void*);
128
129
  void (*update_status)(void*);         /* Before release of write */
129
130
  void (*restore_status)(void*);         /* Before release of read */
130
 
  bool (*check_status)(void *);
 
131
  my_bool (*check_status)(void *);
131
132
} THR_LOCK;
132
133
 
133
134
 
134
135
extern LIST *thr_lock_thread_list;
135
136
 
136
 
bool init_thr_lock(void);               /* Must be called once/thread */
 
137
my_bool init_thr_lock(void);            /* Must be called once/thread */
137
138
#define thr_lock_owner_init(owner, info_arg) (owner)->info= (info_arg)
138
139
void thr_lock_info_init(THR_LOCK_INFO *info);
139
140
void thr_lock_init(THR_LOCK *lock);
145
146
                                   enum thr_lock_type lock_type);
146
147
void thr_unlock(THR_LOCK_DATA *data);
147
148
enum enum_thr_lock_result thr_multi_lock(THR_LOCK_DATA **data,
148
 
                                         uint32_t count, THR_LOCK_OWNER *owner);
149
 
void thr_multi_unlock(THR_LOCK_DATA **data,uint32_t count);
150
 
void thr_abort_locks(THR_LOCK *lock, bool upgrade_lock);
151
 
bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
152
 
bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);
 
149
                                         uint count, THR_LOCK_OWNER *owner);
 
150
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
 
151
void thr_abort_locks(THR_LOCK *lock, my_bool upgrade_lock);
 
152
my_bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
 
153
void thr_print_locks(void);             /* For debugging */
 
154
my_bool thr_upgrade_write_delay_lock(THR_LOCK_DATA *data);
153
155
void    thr_downgrade_write_lock(THR_LOCK_DATA *data,
154
156
                                 enum thr_lock_type new_lock_type);
155
 
bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
 
157
my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data);
156
158
#ifdef  __cplusplus
157
159
}
158
160
#endif