00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "heap_priv.h"
00017
00018 using namespace std;
00019 using namespace drizzled;
00020
00021
00022
00023
00024 int hp_panic(enum ha_panic_function flag)
00025 {
00026 THR_LOCK_heap.lock();
00027 list<HP_INFO *>::iterator info_it= heap_open_list.begin();
00028 while (info_it != heap_open_list.end())
00029 {
00030 HP_INFO *info= *info_it;
00031 switch (flag) {
00032 case HA_PANIC_CLOSE:
00033 hp_close(info);
00034 break;
00035 default:
00036 break;
00037 }
00038 ++info_it;
00039 }
00040 list<HP_SHARE *>::iterator share_it= heap_share_list.begin();
00041 while (share_it != heap_share_list.end())
00042 {
00043 HP_SHARE *share= *share_it;
00044 switch (flag) {
00045 case HA_PANIC_CLOSE:
00046 {
00047 if (!share->open_count)
00048 hp_free(share);
00049 break;
00050 }
00051 default:
00052 break;
00053 }
00054 ++share_it;
00055 }
00056 THR_LOCK_heap.unlock();
00057 return(0);
00058 }