~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_base.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:
16
16
 
17
17
/* Basic functions needed by many modules */
18
18
#include <drizzled/server_includes.h>
19
 
#include <drizzled/sql_select.h>
20
 
#include <mysys/my_dir.h>
21
 
#include <drizzled/error.h>
22
 
#include <drizzled/gettext.h>
23
 
#include <drizzled/nested_join.h>
 
19
#include <signal.h>
24
20
 
25
21
#if TIME_WITH_SYS_TIME
26
22
# include <sys/time.h>
32
28
#  include <time.h>
33
29
# endif
34
30
#endif
 
31
#include <mysys/my_pthread.h>
 
32
 
 
33
#include <drizzled/sql_select.h>
 
34
#include <mysys/my_dir.h>
 
35
#include <drizzled/error.h>
 
36
#include <drizzled/gettext.h>
 
37
#include <drizzled/nested_join.h>
 
38
#include <drizzled/sql_base.h>
 
39
#include <drizzled/show.h>
 
40
 
35
41
 
36
42
/**
37
43
  return true if the table was created explicitly.
6559
6565
/**
6560
6566
  @} (end of group Data_Dictionary)
6561
6567
*/
 
6568
 
 
6569
void kill_drizzle(void)
 
6570
{
 
6571
 
 
6572
#if defined(SIGNALS_DONT_BREAK_READ)
 
6573
  abort_loop=1;                                 // Break connection loops
 
6574
  close_server_sock();                          // Force accept to wake up
 
6575
#endif
 
6576
 
 
6577
#if defined(HAVE_PTHREAD_KILL)
 
6578
  pthread_kill(signal_thread, SIGTERM);
 
6579
#elif !defined(SIGNALS_DONT_BREAK_READ)
 
6580
  kill(current_pid, SIGTERM);
 
6581
#endif
 
6582
  shutdown_in_progress=1;                       // Safety if kill didn't work
 
6583
#ifdef SIGNALS_DONT_BREAK_READ
 
6584
  if (!kill_in_progress)
 
6585
  {
 
6586
    pthread_t tmp;
 
6587
    abort_loop=1;
 
6588
    if (pthread_create(&tmp,&connection_attrib, kill_server_thread,
 
6589
                           (void*) 0))
 
6590
      sql_print_error(_("Can't create thread to kill server"));
 
6591
  }
 
6592
#endif
 
6593
  return;;
 
6594
}