~drizzle-developers/ubuntu/natty/drizzle/natty

« back to all changes in this revision

Viewing changes to drizzled/main.cc

  • Committer: Monty Taylor
  • Date: 2010-09-30 04:11:21 UTC
  • mfrom: (1308.1.92 debian)
  • Revision ID: mordred@inaugust.com-20100930041121-g7xla0wwrhvb7uoh
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
  google::protobuf::SetLogHandler(&GoogleProtoErrorThrower);
237
237
 
238
238
  /* Function generates error messages before abort */
 
239
  error_handler_hook= my_message_sql;
239
240
  /* init_common_variables must get basic settings such as data_home_dir
240
241
     and plugin_load_list. */
241
 
  if (init_common_variables(argc, argv))
 
242
  if (init_common_variables(argc, argv, modules))
242
243
    unireg_abort(1);                            // Will do exit
243
244
 
 
245
  /*
 
246
    init signals & alarm
 
247
    After this we can't quit by a simple unireg_abort
 
248
  */
244
249
  init_signals();
245
250
 
246
251
 
269
274
    }
270
275
    /* TODO: This is a hack until we can properly support std::string in sys_var*/
271
276
    char **data_home_ptr= getDatadirPtr();
272
 
    *data_home_ptr= new char[getDataHome().size()+1] ();
273
277
    fs::path full_data_home_path(fs::system_complete(fs::path(getDataHome())));
274
278
    std::string full_data_home(full_data_home_path.file_string());
 
279
    *data_home_ptr= new char[full_data_home.size()+1] ();
275
280
    memcpy(*data_home_ptr, full_data_home.c_str(), full_data_home.size());
276
281
    getDataHomeCatalog()= "./";
277
282
    getDataHome()= "../";
304
309
  if (plugin::Listen::setup())
305
310
    unireg_abort(1);
306
311
 
307
 
  /*
308
 
    init signals & alarm
309
 
    After this we can't quit by a simple unireg_abort
310
 
  */
311
 
  error_handler_hook= my_message_sql;
312
312
 
313
313
  assert(plugin::num_trx_monitored_objects > 0);
314
314
  if (drizzle_rm_tmp_tables() ||
349
349
  COND_thread_count.notify_all();
350
350
 
351
351
  /* Wait until cleanup is done */
352
 
  LOCK_thread_count.lock();
353
 
  while (!ready_to_exit)
354
 
    pthread_cond_wait(COND_server_end.native_handle(), LOCK_thread_count.native_handle());
355
 
  LOCK_thread_count.unlock();
 
352
  {
 
353
    boost::mutex::scoped_lock scopedLock(LOCK_thread_count);
 
354
    while (!ready_to_exit)
 
355
      COND_server_end.wait(scopedLock);
 
356
  }
356
357
 
357
358
  clean_up(1);
358
359
  module::Registry::shutdown();
359
360
  internal::my_end();
 
361
 
360
362
  return 0;
361
363
}
362
364