~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to include/thr_lock.h

  • Committer: Brian Aker
  • Date: 2008-07-15 06:45:16 UTC
  • Revision ID: brian@tangent.org-20080715064516-fnbq7kowh7w57bxj
Merge Monty's code.

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,
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 */
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);
 
149
                                         uint count, THR_LOCK_OWNER *owner);
 
150
void thr_multi_unlock(THR_LOCK_DATA **data,uint count);
150
151
void thr_abort_locks(THR_LOCK *lock, bool upgrade_lock);
151
152
bool thr_abort_locks_for_thread(THR_LOCK *lock, my_thread_id thread);
 
153
void thr_print_locks(void);             /* For debugging */
152
154
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);