1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Many files:

Free all OS sync primitives and allocated memory in InnoDB shutdown
This commit is contained in:
heikki@hundin.mysql.fi
2003-05-31 03:12:03 +03:00
parent cfda0a16ff
commit 42671d18ae
9 changed files with 214 additions and 107 deletions

View File

@ -1693,7 +1693,17 @@ srv_init(void)
ut_a(conc_slot->event);
}
}
/*************************************************************************
Frees the OS fast mutex created in srv_init(). */
void
srv_free(void)
/*==========*/
{
os_fast_mutex_free(&srv_conc_mutex);
}
/*************************************************************************
Initializes the synchronization primitives, memory system, and the thread
local storage. */
@ -1702,71 +1712,14 @@ void
srv_general_init(void)
/*==================*/
{
os_thread_count_mutex = os_mutex_create(NULL);
os_sync_init();
sync_init();
mem_init(srv_mem_pool_size);
thr_local_init();
}
#if defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
/* NetWare requires some cleanup of mutexes */
/*************************************************************************
Deinitializes the synchronization primitives, memory system, and the thread
local storage. */
void
srv_general_free(void)
/*==================*/
{
sync_close();
os_mutex_free(os_thread_count_mutex);
}
#endif /* __NETWARE__ */
/*======================= InnoDB Server FIFO queue =======================*/
#if defined(__NETWARE__) || defined(SAFE_MUTEX_DETECT_DESTROY)
/* NetWare requires some cleanup of mutexes */
/*************************************************************************
Deinitializes the server. */
void
srv_free(void)
/*==========*/
{
srv_conc_slot_t* conc_slot;
srv_slot_t* slot;
ulint i;
for (i = 0; i < OS_THREAD_MAX_N; i++)
{
slot = srv_table_get_nth_slot(i);
os_event_free(slot->event);
}
/* TODO: free(srv_sys->threads); */
for (i = 0; i < OS_THREAD_MAX_N; i++)
{
slot = srv_mysql_table + i;
os_event_free(slot->event);
}
/* TODO: free(srv_mysql_table); */
for (i = 0; i < OS_THREAD_MAX_N; i++)
{
conc_slot = srv_conc_slots + i;
os_event_free(conc_slot->event);
}
}
#endif /* __NETWARE__ */
/*************************************************************************
Puts an OS thread to wait if there are too many concurrent threads