~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_create.cc

  • Committer: Brian Aker
  • Date: 2010-08-08 04:21:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1697.
  • Revision ID: brian@gaz-20100808042129-x4we3721ql8lfsje
Update for HEAP to convert its lock to boost.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 
53
53
  if (!create_info->internal_table)
54
54
  {
55
 
    pthread_mutex_lock(&THR_LOCK_heap);
 
55
    THR_LOCK_heap.lock();
56
56
    if ((share= hp_find_named_heap(name)) && share->open_count == 0)
57
57
    {
58
58
      hp_free(share);
78
78
        /* Eventual chunk_size cannot be smaller than key data,
79
79
           which allows all keys to fit into the first chunk */
80
80
        my_error(ER_CANT_USE_OPTION_HERE, MYF(0), "block_size");
81
 
        pthread_mutex_unlock(&THR_LOCK_heap);
 
81
        THR_LOCK_heap.unlock();
82
82
        return(ER_CANT_USE_OPTION_HERE);
83
83
      }
84
84
 
364
364
      share->delete_on_close= 1;
365
365
  }
366
366
  if (!create_info->internal_table)
367
 
    pthread_mutex_unlock(&THR_LOCK_heap);
 
367
    THR_LOCK_heap.unlock();
368
368
 
369
369
  *res= share;
370
370
  return(0);
379
379
  if(share)
380
380
    free(share);
381
381
  if (!create_info->internal_table)
382
 
    pthread_mutex_unlock(&THR_LOCK_heap);
 
382
    THR_LOCK_heap.unlock();
383
383
  return(1);
384
384
} /* heap_create */
385
385
 
434
434
  int result;
435
435
  register HP_SHARE *share;
436
436
 
437
 
  pthread_mutex_lock(&THR_LOCK_heap);
 
437
  THR_LOCK_heap.lock();
438
438
  if ((share= hp_find_named_heap(name)))
439
439
  {
440
440
    heap_try_free(share);
444
444
  {
445
445
    result= errno=ENOENT;
446
446
  }
447
 
  pthread_mutex_unlock(&THR_LOCK_heap);
 
447
  THR_LOCK_heap.unlock();
448
448
  return(result);
449
449
}
450
450
 
451
451
 
452
452
void heap_drop_table(HP_INFO *info)
453
453
{
454
 
  pthread_mutex_lock(&THR_LOCK_heap);
 
454
  THR_LOCK_heap.lock();
455
455
  heap_try_free(info->s);
456
 
  pthread_mutex_unlock(&THR_LOCK_heap);
 
456
  THR_LOCK_heap.unlock();
457
457
  return;
458
458
}
459
459