~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2009-02-08 21:17:31 UTC
  • Revision ID: brian@tangent.org-20090208211731-lffufisnysftawvg
Refactor reset of status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2470
2470
 
2471
2471
  return;
2472
2472
}
 
2473
 
 
2474
 
 
2475
/** Clear most status variables. */
 
2476
extern time_t flush_status_time;
 
2477
extern uint32_t max_used_connections;
 
2478
 
 
2479
void Session::refresh_status()
 
2480
{
 
2481
  pthread_mutex_lock(&LOCK_status);
 
2482
 
 
2483
  /* Add thread's status variabes to global status */
 
2484
  add_to_status(&global_status_var, &status_var);
 
2485
 
 
2486
  /* Reset thread's status variables */
 
2487
  memset(&status_var, 0, sizeof(status_var));
 
2488
 
 
2489
  /* Reset some global variables */
 
2490
  reset_status_vars();
 
2491
 
 
2492
  /* Reset the counters of all key caches (default and named). */
 
2493
  process_key_caches(reset_key_cache_counters);
 
2494
  flush_status_time= time((time_t*) 0);
 
2495
  max_used_connections= 1; /* We set it to one, because we know we exist */
 
2496
  pthread_mutex_unlock(&LOCK_status);
 
2497
}