~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_panic.c

  • Committer: Monty Taylor
  • Date: 2008-12-11 02:44:41 UTC
  • mto: This revision was merged to the branch mainline in revision 672.
  • Revision ID: monty@inaugust.com-20081211024441-5dsauvxl7mo7r1hb
Fix for the weird solaris gettext bug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#include "heap_priv.h"
17
 
 
18
 
using namespace std;
19
 
using namespace drizzled;
 
16
#include "heapdef.h"
20
17
 
21
18
        /* if flag == HA_PANIC_CLOSE then all files are removed for more
22
19
           memory */
23
20
 
24
21
int hp_panic(enum ha_panic_function flag)
25
22
{
 
23
  LIST *element,*next_open;
 
24
 
26
25
  pthread_mutex_lock(&THR_LOCK_heap);
27
 
  list<HP_INFO *>::iterator info_it= heap_open_list.begin();
28
 
  while (info_it != heap_open_list.end())
 
26
  for (element=heap_open_list ; element ; element=next_open)
29
27
  {
30
 
    HP_INFO *info= *info_it;
 
28
    HP_INFO *info=(HP_INFO*) element->data;
 
29
    next_open=element->next;    /* Save if close */
31
30
    switch (flag) {
32
31
    case HA_PANIC_CLOSE:
33
32
      hp_close(info);
35
34
    default:
36
35
      break;
37
36
    }
38
 
    ++info_it;
39
37
  }
40
 
  list<HP_SHARE *>::iterator share_it= heap_share_list.begin();
41
 
  while (share_it != heap_share_list.end())
 
38
  for (element=heap_share_list ; element ; element=next_open)
42
39
  {
43
 
    HP_SHARE *share= *share_it;
 
40
    HP_SHARE *share=(HP_SHARE*) element->data;
 
41
    next_open=element->next;    /* Save if close */
44
42
    switch (flag) {
45
43
    case HA_PANIC_CLOSE:
46
44
    {
51
49
    default:
52
50
      break;
53
51
    }
54
 
    ++share_it;
55
52
  }
56
53
  pthread_mutex_unlock(&THR_LOCK_heap);
57
54
  return(0);