mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
os0thread.h, os0sync.ic, os0sync.h, os0thread.c, os0sync.c, os0file.c:
Release all event semaphores at shutdown also in Windows srv0start.c, srv0srv.c: make test sometimes failed because lock timeout thread exited without decrementing the InnoDB thread counter innobase/srv/srv0srv.c: make test sometimes failed because lock timeout thread exited without decrementing the InnoDB thread counter innobase/srv/srv0start.c: make test sometimes failed because lock timeout thread exited without decrementing the InnoDB thread counter innobase/os/os0file.c: Release all event semaphores at shutdown also in Windows innobase/os/os0sync.c: Release all event semaphores at shutdown also in Windows innobase/os/os0thread.c: Release all event semaphores at shutdown also in Windows innobase/include/os0sync.h: Release all event semaphores at shutdown also in Windows innobase/include/os0sync.ic: Release all event semaphores at shutdown also in Windows innobase/include/os0thread.h: Release all event semaphores at shutdown also in Windows
This commit is contained in:
@ -414,8 +414,10 @@ io_handler_thread(
|
||||
|
||||
segment = *((ulint*)arg);
|
||||
|
||||
/* printf("Io handler thread %lu starts\n", segment); */
|
||||
|
||||
#ifdef UNIV_DEBUG_THREAD_CREATION
|
||||
printf("Io handler thread %lu starts\n", segment);
|
||||
printf("Thread id %lu\n", os_thread_pf(os_thread_get_curr_id()));
|
||||
#endif
|
||||
for (i = 0;; i++) {
|
||||
fil_aio_wait(segment);
|
||||
|
||||
@ -424,6 +426,13 @@ io_handler_thread(
|
||||
mutex_exit(&ios_mutex);
|
||||
}
|
||||
|
||||
/* We count the number of threads in os_thread_exit(). A created
|
||||
thread should always use that to exit and not use return() to exit.
|
||||
The thread actually never comes here because it is exited in an
|
||||
os_event_wait(). */
|
||||
|
||||
os_thread_exit(NULL);
|
||||
|
||||
#ifndef __WIN__
|
||||
return(NULL);
|
||||
#else
|
||||
@ -1546,21 +1555,32 @@ innobase_shutdown_for_mysql(void)
|
||||
os_thread_count);
|
||||
}
|
||||
|
||||
/* 3. Free all InnoDB's own mutexes */
|
||||
/* 3. Free all InnoDB's own mutexes and the os_fast_mutexes inside
|
||||
them */
|
||||
|
||||
sync_close();
|
||||
|
||||
/* 4. Free all OS synchronization primitives (in Windows currently
|
||||
events are not freed) */
|
||||
/* 4. Free the os_conc_mutex and all os_events and os_mutexes */
|
||||
|
||||
srv_free();
|
||||
os_sync_free();
|
||||
|
||||
/* 5. Free all allocated memory (and the os_fast_mutex created in
|
||||
/* 5. Free all allocated memory and the os_fast_mutex created in
|
||||
ut0mem.c */
|
||||
|
||||
ut_free_all_mem();
|
||||
|
||||
if (os_thread_count != 0
|
||||
|| os_event_count != 0
|
||||
|| os_mutex_count != 0
|
||||
|| os_fast_mutex_count != 0) {
|
||||
fprintf(stderr,
|
||||
"InnoDB: Warning: some resources were not cleaned up in shutdown:\n"
|
||||
"InnoDB: threads %lu, events %lu, os_mutexes %lu, os_fast_mutexes %lu\n",
|
||||
os_thread_count, os_event_count, os_mutex_count,
|
||||
os_fast_mutex_count);
|
||||
}
|
||||
|
||||
if (srv_print_verbose_log) {
|
||||
ut_print_timestamp(stderr);
|
||||
fprintf(stderr, " InnoDB: Shutdown completed\n");
|
||||
|
Reference in New Issue
Block a user