~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Brian Aker
  • Date: 2009-02-26 05:21:02 UTC
  • mfrom: (896.1.5 fix-osxs)
  • Revision ID: brian@intel-mini-2.local-20090226052102-8xtbjt8kph6mi0qx
Merge from Monty.

Show diffs side-by-side

added added

removed removed

Lines of Context:
303
303
uint32_t volatile thread_count, thread_running;
304
304
uint64_t session_startup_options;
305
305
uint32_t back_log;
306
 
uint64_t connect_timeout;
 
306
uint32_t connect_timeout;
307
307
uint32_t server_id;
308
308
uint64_t table_cache_size;
309
309
uint64_t table_def_size;
490
490
 
491
491
static void close_connections(void)
492
492
{
493
 
#ifdef EXTRA_DEBUG
494
 
  int count=0;
495
 
#endif
496
493
 
497
494
  /* kill connection thread */
498
495
  (void) pthread_mutex_lock(&LOCK_thread_count);
510
507
      if (error != EINTR)
511
508
        break;
512
509
    }
513
 
#ifdef EXTRA_DEBUG
514
 
    if (error != 0 && !count++)
515
 
        errmsg_printf(ERRMSG_LVL_ERROR, _("Got error %d from pthread_cond_timedwait"),error);
516
 
#endif
517
510
    close_server_sock();
518
511
  }
519
512
  (void) pthread_mutex_unlock(&LOCK_thread_count);
1423
1416
    stack size in reality, so we have to double it here
1424
1417
  */
1425
1418
  pthread_attr_setstacksize(&thr_attr,my_thread_stack_size*2);
1426
 
#endif
 
1419
# else
1427
1420
  pthread_attr_setstacksize(&thr_attr,my_thread_stack_size);
 
1421
#endif
1428
1422
 
1429
1423
  (void) pthread_mutex_lock(&LOCK_thread_count);
1430
1424
  if ((error=pthread_create(&signal_thread,&thr_attr,signal_hand,0)))
1506
1500
    {
1507
1501
      my_thread_end();
1508
1502
      signal_thread_in_use= 0;
1509
 
      pthread_exit(0);                          // Safety
 
1503
      return NULL;
1510
1504
    }
1511
1505
    switch (sig) {
1512
1506
    case SIGTERM:
1515
1509
      /* switch to the old log message processing */
1516
1510
      if (!abort_loop)
1517
1511
      {
1518
 
        abort_loop=1;                           // mark abort for threads
 
1512
        abort_loop=1;                           // mark abort for threads
1519
1513
        kill_server((void*) sig);       // MIT THREAD has a alarm thread
1520
1514
      }
1521
1515
      break;
1533
1527
      break;                                    /* purecov: tested */
1534
1528
    }
1535
1529
  }
1536
 
 
1537
 
  return 0;
1538
1530
}
1539
1531
 
1540
1532
static void check_data_home(const char *)
1910
1902
  if (table_cache_init() | table_def_init())
1911
1903
    unireg_abort(1);
1912
1904
 
1913
 
  drizzleclient_drizzleclient_randominit(&sql_rand,(uint32_t) server_start_time,(uint32_t) server_start_time/2);
 
1905
  drizzleclient_randominit(&sql_rand,
 
1906
                           (uint64_t) server_start_time,
 
1907
                           (uint64_t) server_start_time/2);
1914
1908
  setup_fpu();
1915
1909
  init_thr_lock();
1916
1910
 
2173
2167
  /* (void) pthread_attr_destroy(&connection_attrib); */
2174
2168
 
2175
2169
 
2176
 
#ifdef EXTRA_DEBUG2
2177
 
  errmsg_printf(ERRMSG_LVL_ERROR, _("Before Lock_thread_count"));
2178
 
#endif
2179
2170
  (void) pthread_mutex_lock(&LOCK_thread_count);
2180
2171
  select_thread_in_use=0;                       // For close_connections
2181
2172
  (void) pthread_mutex_unlock(&LOCK_thread_count);
2182
2173
  (void) pthread_cond_broadcast(&COND_thread_count);
2183
 
#ifdef EXTRA_DEBUG2
2184
 
  errmsg_printf(ERRMSG_LVL_ERROR, _("After lock_thread_count"));
2185
 
#endif
2186
2174
 
2187
2175
  /* Wait until cleanup is done */
2188
2176
  (void) pthread_mutex_lock(&LOCK_thread_count);
2708
2696
    N_("The number of seconds the drizzled server is waiting for a connect "
2709
2697
       "packet before responding with 'Bad handshake'."),
2710
2698
    (char**) &connect_timeout, (char**) &connect_timeout,
2711
 
    0, GET_ULL, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
 
2699
    0, GET_ULONG, REQUIRED_ARG, CONNECT_TIMEOUT, 2, LONG_TIMEOUT, 0, 1, 0 },
2712
2700
  { "date_format", OPT_DATE_FORMAT,
2713
2701
    N_("The DATE format (For future)."),
2714
2702
    (char**) &opt_date_time_formats[DRIZZLE_TIMESTAMP_DATE],