~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/srv/srv0start.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
463
463
                        the aio array */
464
464
{
465
465
        ulint   segment;
466
 
        ulint   i;
467
466
 
468
467
        segment = *((ulint*)arg);
469
468
 
471
470
        fprintf(stderr, "Io handler thread %lu starts, id %lu\n", segment,
472
471
                os_thread_pf(os_thread_get_curr_id()));
473
472
#endif
474
 
        for (i = 0;; i++) {
 
473
        while (srv_shutdown_state != SRV_SHUTDOWN_EXIT_THREADS) {
475
474
                fil_aio_wait(segment);
476
475
 
477
476
                mutex_enter(&ios_mutex);
479
478
                mutex_exit(&ios_mutex);
480
479
        }
481
480
 
482
 
        thr_local_free(os_thread_get_curr_id());
483
 
 
484
481
        /* We count the number of threads in os_thread_exit(). A created
485
482
        thread should always use that to exit and not use return() to exit.
486
483
        The thread actually never comes here because it is exited in an
1064
1061
                );
1065
1062
#endif
1066
1063
 
 
1064
#ifdef UNIV_BLOB_DEBUG
 
1065
        fprintf(stderr,
 
1066
                "InnoDB: !!!!!!!! UNIV_BLOB_DEBUG switched on !!!!!!!!!\n"
 
1067
                "InnoDB: Server restart may fail with UNIV_BLOB_DEBUG\n");
 
1068
#endif /* UNIV_BLOB_DEBUG */
 
1069
 
1067
1070
#ifdef UNIV_SYNC_DEBUG
1068
1071
        fprintf(stderr,
1069
1072
                "InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n");
1289
1292
        fil_init(srv_file_per_table ? 50000 : 5000,
1290
1293
                 srv_max_n_open_files);
1291
1294
 
 
1295
        /* Print time to initialize the buffer pool */
 
1296
        ut_print_timestamp(stderr);
 
1297
        fprintf(stderr,
 
1298
                "  InnoDB: Initializing buffer pool, size =");
 
1299
 
 
1300
        if (srv_buf_pool_size >= 1024 * 1024 * 1024) {
 
1301
                fprintf(stderr,
 
1302
                        " %.1fG\n",
 
1303
                        ((double) srv_buf_pool_size) / (1024 * 1024 * 1024));
 
1304
        } else {
 
1305
                fprintf(stderr,
 
1306
                        " %.1fM\n",
 
1307
                        ((double) srv_buf_pool_size) / (1024 * 1024));
 
1308
        }
 
1309
 
1292
1310
        ret = buf_pool_init();
1293
1311
 
 
1312
        ut_print_timestamp(stderr);
 
1313
 
1294
1314
        if (ret == NULL) {
1295
1315
                fprintf(stderr,
1296
1316
                        "InnoDB: Fatal error: cannot allocate the memory"
1299
1319
                return(DB_ERROR);
1300
1320
        }
1301
1321
 
 
1322
        fprintf(stderr,
 
1323
                "  InnoDB: Completed initialization of buffer pool\n");
 
1324
 
1302
1325
#ifdef UNIV_DEBUG
1303
1326
        /* We have observed deadlocks with a 5MB buffer pool but
1304
1327
        the actual lower limit could very well be a little higher. */
1894
1917
#ifdef __NETWARE__
1895
1918
        if (!panic_shutdown)
1896
1919
#endif
1897
 
                logs_empty_and_mark_files_at_shutdown();
 
1920
        logs_empty_and_mark_files_at_shutdown();
1898
1921
 
1899
1922
        if (srv_conc_n_threads != 0) {
1900
1923
                fprintf(stderr,
2018
2041
        pars_lexer_close();
2019
2042
        log_mem_free();
2020
2043
        buf_pool_free();
 
2044
        mem_close();
 
2045
 
 
2046
        /* ut_free_all_mem() frees all allocated memory not freed yet
 
2047
        in shutdown, and it will also free the ut_list_mutex, so it
 
2048
        should be the last one for all operation */
2021
2049
        ut_free_all_mem();
2022
 
        mem_close();
2023
2050
 
2024
2051
        if (os_thread_count != 0
2025
2052
            || os_event_count != 0