355
355
reading of a disk page */
356
356
UNIV_INTERN ulint srv_buf_pool_reads = 0;
358
/** Time in seconds between automatic buffer pool dumps */
359
UNIV_INTERN uint srv_auto_lru_dump = 0;
358
361
/* structure to pass status variables to MySQL */
359
362
UNIV_INTERN export_struc export_vars;
2471
2474
OS_THREAD_DUMMY_RETURN;
2477
/*********************************************************************//**
2478
A thread which restores the buffer pool from a dump file on startup and does
2479
periodic buffer pool dumps.
2480
@return a dummy parameter */
2483
srv_LRU_dump_restore_thread(
2484
/*====================*/
2485
void* /*arg __attribute__((unused))*/)
2486
/*!< in: a dummy parameter required by
2490
time_t last_dump_time;
2491
time_t time_elapsed;
2493
#ifdef UNIV_DEBUG_THREAD_CREATION
2494
fprintf(stderr, "The LRU dump/restore thread has started, id %lu\n",
2495
os_thread_pf(os_thread_get_curr_id()));
2498
if (srv_auto_lru_dump)
2499
buf_LRU_file_restore();
2501
last_dump_time = time(NULL);
2504
os_thread_sleep(5000000);
2506
if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) {
2510
time_elapsed = time(NULL) - last_dump_time;
2511
auto_lru_dump = srv_auto_lru_dump;
2512
if (auto_lru_dump > 0 && (time_t) auto_lru_dump < time_elapsed) {
2513
last_dump_time = time(NULL);
2514
buf_LRU_file_dump();
2519
/* We count the number of threads in os_thread_exit(). A created
2520
thread should always use that to exit and not use return() to exit. */
2522
os_thread_exit(NULL);
2524
OS_THREAD_DUMMY_RETURN;
2474
2527
/**********************************************************************//**
2475
2528
Check whether any background thread is active.
2476
2529
@return FALSE if all are are suspended or have exited. */