~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_keycache.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-28 06:09:15 UTC
  • mto: (968.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 971.
  • Revision ID: osullivan.padraig@gmail.com-20090328060915-46xg06g2lavjmbhn
Refactoring MyISAM storage engine again based on LIST replacement with
std::list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
void mi_change_key_cache(KEY_CACHE *old_key_cache,
135
135
                         KEY_CACHE *new_key_cache)
136
136
{
137
 
  LIST *pos;
138
 
 
139
137
  /*
140
138
    Lock list to ensure that no one can close the table while we manipulate it
141
139
  */
142
140
  pthread_mutex_lock(&THR_LOCK_myisam);
143
 
  for (pos=myisam_open_list ; pos ; pos=pos->next)
 
141
  list<MI_INFO *>::iterator it= myisam_open_list.begin();
 
142
  while (it != myisam_open_list.end())
144
143
  {
145
 
    MI_INFO *info= (MI_INFO*) pos->data;
 
144
    MI_INFO *info= *it;
146
145
    MYISAM_SHARE *share= info->s;
147
146
    if (share->key_cache == old_key_cache)
148
147
      mi_assign_to_key_cache(info, UINT64_MAX, new_key_cache);
 
148
    ++it;
149
149
  }
150
150
 
151
151
  /*