~cuteyw/drizzle/cloud-storage-engine-using-json-row-buffer-format

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_open.cc

  • Committer: cactus
  • Date: 2010-08-19 16:08:27 UTC
  • mfrom: (1660.2.58 drizzle)
  • Revision ID: cactus@cactus-desktop-20100819160827-q5qfos3yc4i5mxbd
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
    internal::my_load_path(rp_buff,org_name, NULL);
103
103
  rp_buff[FN_REFLEN-1]= '\0';
104
104
  strcpy(name_buff,rp_buff);
105
 
  pthread_mutex_lock(&THR_LOCK_myisam);
 
105
  THR_LOCK_myisam.lock();
106
106
  if (!(old_info=test_if_reopen(name_buff)))
107
107
  {
108
108
    share= &share_buff;
247
247
           &share->state.key_root,keys*sizeof(uint64_t),
248
248
           &share->state.key_del,
249
249
           (share->state.header.max_block_size_index*sizeof(uint64_t)),
250
 
           &share->key_root_lock,sizeof(pthread_rwlock_t)*keys,
251
 
           &share->mmap_lock,sizeof(pthread_rwlock_t),
252
250
           NULL))
253
251
      goto err;
254
252
    errpos=4;
390
388
    mi_setup_functions(share);
391
389
    share->is_log_table= false;
392
390
    thr_lock_init(&share->lock);
393
 
    pthread_mutex_init(&share->intern_lock,MY_MUTEX_INIT_FAST);
394
 
    for (i=0; i<keys; i++)
395
 
      pthread_rwlock_init(&share->key_root_lock[i], NULL);
396
 
    pthread_rwlock_init(&share->mmap_lock, NULL);
397
391
    if (myisam_concurrent_insert)
398
392
    {
399
393
      share->concurrent_insert=
459
453
  info.bulk_insert=0;
460
454
  info.errkey= -1;
461
455
  info.page_changed=1;
462
 
  pthread_mutex_lock(&share->intern_lock);
463
456
  info.read_record=share->read_record;
464
457
  share->reopen++;
465
458
  share->write_flag=MYF(MY_NABP | MY_WAIT_IF_FULL);
489
482
 
490
483
  share->delay_key_write= 1;
491
484
  info.state= &share->state.state;      /* Change global values by default */
492
 
  pthread_mutex_unlock(&share->intern_lock);
493
485
 
494
486
  /* Allocate buffer for one record */
495
487
 
502
494
  m_info->lock.init(&share->lock, (void*) m_info);
503
495
  myisam_open_list.push_front(m_info);
504
496
 
505
 
  pthread_mutex_unlock(&THR_LOCK_myisam);
 
497
  THR_LOCK_myisam.unlock();
506
498
  return(m_info);
507
499
 
508
500
err:
534
526
  default:
535
527
    break;
536
528
  }
537
 
  pthread_mutex_unlock(&THR_LOCK_myisam);
 
529
  THR_LOCK_myisam.unlock();
538
530
  errno=save_errno;
539
531
  return (NULL);
540
532
} /* mi_open */