summaryrefslogtreecommitdiff
path: root/innobase/srv/srv0start.c
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-06-05 17:33:38 +0300
committerunknown <monty@narttu.mysql.fi>2003-06-05 17:33:38 +0300
commit64d11bb395348ec002760d5354fbec0e373db593 (patch)
tree2f66999790d27b10bd1ddb8bdc47741a04c5c502 /innobase/srv/srv0start.c
parentad5e39bf12b7aeefbc313e464a1349541a7b15c5 (diff)
parenta3afb2bcbea96d4c5a326204151fb63cd0411aec (diff)
downloadmariadb-git-64d11bb395348ec002760d5354fbec0e373db593.tar.gz
Merge with 4.0.13
BitKeeper/deleted/.del-internals.texi~62b6f580a41c2a43: Auto merged innobase/os/os0file.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/srv/srv0start.c: Auto merged mysql-test/r/func_str.result: Auto merged mysql-test/r/rpl_loaddata.result: Auto merged mysql-test/t/rpl_loaddata.test: Auto merged sql/handler.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/net_serv.cc: Auto merged sql/slave.cc: Auto merged sql/sql_repl.cc: Auto merged support-files/mysql.spec.sh: Auto merged
Diffstat (limited to 'innobase/srv/srv0start.c')
-rw-r--r--innobase/srv/srv0start.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 9a2bf72130b..ad985d8282d 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -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
@@ -1585,21 +1594,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");