~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/myisam/mi_panic.cc

  • Committer: Brian Aker
  • Date: 2010-08-18 16:12:58 UTC
  • mto: This revision was merged to the branch mainline in revision 1720.
  • Revision ID: brian@tangent.org-20100818161258-1vm71da888dfvwsx
Remove the code surrounding stack trace.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
  int error=0;
32
32
  MI_INFO *info;
33
33
 
34
 
  pthread_mutex_lock(&THR_LOCK_myisam);
 
34
  THR_LOCK_myisam.lock();
35
35
  list<MI_INFO *>::iterator it= myisam_open_list.begin();
36
36
  while (it != myisam_open_list.end())
37
37
  {
38
38
    info= *it;
39
39
    switch (flag) {
40
40
    case HA_PANIC_CLOSE:
41
 
      pthread_mutex_unlock(&THR_LOCK_myisam);   /* Not exactly right... */
 
41
      THR_LOCK_myisam.unlock(); /* Not exactly right... */
42
42
      if (mi_close(info))
43
43
        error=errno;
44
 
      pthread_mutex_lock(&THR_LOCK_myisam);
 
44
      THR_LOCK_myisam.lock();
45
45
      break;
46
46
    case HA_PANIC_WRITE:                /* Do this to free databases */
47
47
#ifdef CANT_OPEN_FILES_TWICE
48
48
      if (info->s->options & HA_OPTION_READ_ONLY_DATA)
49
49
        break;
50
50
#endif
51
 
      if (flush_key_blocks(info->s->key_cache, info->s->kfile, FLUSH_RELEASE))
 
51
      if (flush_key_blocks(info->s->getKeyCache(), info->s->kfile, FLUSH_RELEASE))
52
52
        error=errno;
53
53
      if (info->opt_flag & WRITE_CACHE_USED)
54
54
        if (flush_io_cache(&info->rec_cache))
103
103
    }
104
104
    ++it;
105
105
  }
106
 
  pthread_mutex_unlock(&THR_LOCK_myisam);
 
106
  THR_LOCK_myisam.unlock();
107
107
  if (!error)
108
108
    return(0);
109
109
  return(errno=error);