~dshrews/drizzle/bugs_626566_637590

« back to all changes in this revision

Viewing changes to drizzled/table_share.cc

  • Committer: David Shrewsbury
  • Date: 2010-09-13 22:12:45 UTC
  • mfrom: (1760.2.1 staging)
  • Revision ID: shrewsbury.dave@gmail.com-20100913221245-5k1deo5qtt6qbqn7
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
742
742
    TableIdentifier::build_table_filename(_path, db.str, table_name.str, false);
743
743
  }
744
744
 
745
 
  if (mem_root.multi_alloc_root(0,
746
 
                                &path_buff, _path.length() + 1,
747
 
                                NULL))
 
745
  if ((path_buff= (char *)mem_root.alloc_root(_path.length() + 1)))
748
746
  {
749
747
    setPath(path_buff, _path.length());
750
748
    strcpy(path_buff, _path.c_str());
751
749
    setNormalizedPath(path_buff, _path.length());
752
750
 
753
751
    version= refresh_version;
754
 
 
755
 
    pthread_mutex_init(&mutex, MY_MUTEX_INIT_FAST);
756
 
    pthread_cond_init(&cond, NULL);
757
752
  }
758
753
  else
759
754
  {
789
784
    /* share->mutex is locked in release_table_share() */
790
785
    while (waiting_on_cond)
791
786
    {
792
 
      pthread_cond_broadcast(&cond);
793
 
      pthread_cond_wait(&cond, &mutex);
 
787
      cond.notify_all();
 
788
      pthread_cond_wait(cond.native_handle(), mutex.native_handle());
794
789
    }
795
790
    /* No thread refers to this anymore */
796
 
    pthread_mutex_unlock(&mutex);
797
 
    pthread_mutex_destroy(&mutex);
798
 
    pthread_cond_destroy(&cond);
 
791
    mutex.unlock();
799
792
  }
800
793
 
801
794
  storage_engine= NULL;