~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mf_keycaches.c

Removed/replaced DBUG symbols and TRUE/FALSE

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry)
72
72
{
 
73
  DBUG_ENTER("free_assign_entry");
73
74
  my_free((uchar*) entry, MYF(0));
74
 
  return;
 
75
  DBUG_VOID_RETURN;
75
76
}
76
77
 
77
78
 
106
107
static my_bool safe_hash_init(SAFE_HASH *hash, uint elements,
107
108
                              uchar *default_value)
108
109
{
 
110
  DBUG_ENTER("safe_hash");
109
111
  if (hash_init(&hash->hash, &my_charset_bin, elements,
110
112
                0, 0, (hash_get_key) safe_hash_entry_get,
111
113
                (void (*)(void*)) safe_hash_entry_free, 0))
112
114
  {
113
115
    hash->default_value= 0;
114
 
    return(1);
 
116
    DBUG_RETURN(1);
115
117
  }
116
118
  my_rwlock_init(&hash->mutex, 0);
117
119
  hash->default_value= default_value;
118
120
  hash->root= 0;
119
 
  return(0);
 
121
  DBUG_RETURN(0);
120
122
}
121
123
 
122
124
 
148
150
static uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length)
149
151
{
150
152
  uchar *result;
 
153
  DBUG_ENTER("safe_hash_search");
151
154
  rw_rdlock(&hash->mutex);
152
155
  result= hash_search(&hash->hash, key, length);
153
156
  rw_unlock(&hash->mutex);
155
158
    result= hash->default_value;
156
159
  else
157
160
    result= ((SAFE_HASH_ENTRY*) result)->data;
158
 
  return(result);
 
161
  DBUG_PRINT("exit",("data: 0x%lx", (long) result));
 
162
  DBUG_RETURN(result);
159
163
}
160
164
 
161
165
 
184
188
{
185
189
  SAFE_HASH_ENTRY *entry;
186
190
  my_bool error= 0;
 
191
  DBUG_ENTER("safe_hash_set");
 
192
  DBUG_PRINT("enter",("key: %.*s  data: 0x%lx", length, key, (long) data));
187
193
 
188
194
  rw_wrlock(&hash->mutex);
189
195
  entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length);
236
242
 
237
243
end:
238
244
  rw_unlock(&hash->mutex);
239
 
  return(error);
 
245
  DBUG_RETURN(error);
240
246
}
241
247
 
242
248
 
258
264
static void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data)
259
265
{
260
266
  SAFE_HASH_ENTRY *entry, *next;
 
267
  DBUG_ENTER("safe_hash_set");
261
268
 
262
269
  rw_wrlock(&hash->mutex);
263
270
 
278
285
  }
279
286
 
280
287
  rw_unlock(&hash->mutex);
281
 
  return;
 
288
  DBUG_VOID_RETURN;
282
289
}
283
290
 
284
291