~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_keycache.cc

Merged padraig's removal of list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "myisamdef.h"
21
21
 
 
22
using namespace std;
 
23
 
22
24
/*
23
25
  Assign pages of the index file for a table to a key cache
24
26
 
134
136
void mi_change_key_cache(KEY_CACHE *old_key_cache,
135
137
                         KEY_CACHE *new_key_cache)
136
138
{
137
 
  LIST *pos;
138
 
 
139
139
  /*
140
140
    Lock list to ensure that no one can close the table while we manipulate it
141
141
  */
142
142
  pthread_mutex_lock(&THR_LOCK_myisam);
143
 
  for (pos=myisam_open_list ; pos ; pos=pos->next)
 
143
  list<MI_INFO *>::iterator it= myisam_open_list.begin();
 
144
  while (it != myisam_open_list.end())
144
145
  {
145
 
    MI_INFO *info= (MI_INFO*) pos->data;
 
146
    MI_INFO *info= *it;
146
147
    MYISAM_SHARE *share= info->s;
147
148
    if (share->key_cache == old_key_cache)
148
149
      mi_assign_to_key_cache(info, UINT64_MAX, new_key_cache);
 
150
    ++it;
149
151
  }
150
152
 
151
153
  /*