~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_class.cc

  • Committer: Monty Taylor
  • Date: 2008-11-12 17:42:40 UTC
  • mto: This revision was merged to the branch mainline in revision 584.
  • Revision ID: monty@inaugust.com-20081112174240-l2vg9lnzbmjc3uyk
More header cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2856
2856
  elements++;
2857
2857
  return(0);
2858
2858
}
 
2859
 
 
2860
/**
 
2861
  Close a connection.
 
2862
 
 
2863
  @param session                Thread handle
 
2864
  @param errcode        Error code to print to console
 
2865
  @param lock           1 if we have have to lock LOCK_thread_count
 
2866
 
 
2867
  @note
 
2868
    For the connection that is doing shutdown, this is called twice
 
2869
*/
 
2870
void close_connection(Session *session, uint32_t errcode, bool lock)
 
2871
{
 
2872
  st_vio *vio;
 
2873
  if (lock)
 
2874
    (void) pthread_mutex_lock(&LOCK_thread_count);
 
2875
  session->killed= Session::KILL_CONNECTION;
 
2876
  if ((vio= session->net.vio) != 0)
 
2877
  {
 
2878
    if (errcode)
 
2879
      net_send_error(session, errcode, ER(errcode)); /* purecov: inspected */
 
2880
    net_close(&(session->net));         /* vio is freed in delete session */
 
2881
  }
 
2882
  if (lock)
 
2883
    (void) pthread_mutex_unlock(&LOCK_thread_count);
 
2884
  return;;
 
2885
}