~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/thr_lock.c

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
 
113
113
#ifdef EXTRA_DEBUG
114
114
#define MAX_FOUND_ERRORS        10              /* Report 10 first errors */
115
 
static uint found_errors=0;
 
115
static uint32_t found_errors=0;
116
116
 
117
117
static int check_lock(struct st_lock_list *list, const char* lock_type,
118
118
                      const char *where, bool same_owner, bool no_cond)
119
119
{
120
120
  THR_LOCK_DATA *data,**prev;
121
 
  uint count=0;
 
121
  uint32_t count=0;
122
122
  THR_LOCK_OWNER *first_owner;
123
123
 
124
124
  prev= &list->data;
177
177
static void check_locks(THR_LOCK *lock, const char *where,
178
178
                        bool allow_no_locks)
179
179
{
180
 
  uint old_found_errors=found_errors;
 
180
  uint32_t old_found_errors=found_errors;
181
181
 
182
182
  if (found_errors < MAX_FOUND_ERRORS)
183
183
  {
189
189
 
190
190
    if (found_errors < MAX_FOUND_ERRORS)
191
191
    {
192
 
      uint count=0;
 
192
      uint32_t count=0;
193
193
      THR_LOCK_DATA *data;
194
194
      for (data=lock->read.data ; data ; data=data->next)
195
195
      {
880
880
 
881
881
#define LOCK_CMP(A,B) ((unsigned char*) (A->lock) - (uint) ((A)->type) < (unsigned char*) (B->lock)- (uint) ((B)->type))
882
882
 
883
 
static void sort_locks(THR_LOCK_DATA **data,uint count)
 
883
static void sort_locks(THR_LOCK_DATA **data,uint32_t count)
884
884
{
885
885
  THR_LOCK_DATA **pos,**end,**prev,*tmp;
886
886
 
902
902
 
903
903
 
904
904
enum enum_thr_lock_result
905
 
thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_OWNER *owner)
 
905
thr_multi_lock(THR_LOCK_DATA **data, uint32_t count, THR_LOCK_OWNER *owner)
906
906
{
907
907
  THR_LOCK_DATA **pos,**end;
908
908
  if (count > 1)
973
973
 
974
974
  /* free all locks */
975
975
 
976
 
void thr_multi_unlock(THR_LOCK_DATA **data,uint count)
 
976
void thr_multi_unlock(THR_LOCK_DATA **data,uint32_t count)
977
977
{
978
978
  THR_LOCK_DATA **pos,**end;
979
979
 
1207
1207
#ifdef MAIN
1208
1208
 
1209
1209
struct st_test {
1210
 
  uint lock_nr;
 
1210
  uint32_t lock_nr;
1211
1211
  enum thr_lock_type lock_type;
1212
1212
};
1213
1213
 
1256
1256
 
1257
1257
static pthread_cond_t COND_thread_count;
1258
1258
static pthread_mutex_t LOCK_thread_count;
1259
 
static uint thread_count;
 
1259
static uint32_t thread_count;
1260
1260
static uint32_t sum=0;
1261
1261
 
1262
1262
#define MAX_LOCK_COUNT 8