manager.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

void manager (const char *socket_file_name)


Function Documentation

void manager const char *  socket_file_name  ) 
 

00028 {
00029   Thread_repository thread_repository;
00030   Listener_thread_args listener_args(thread_repository, socket_file_name);
00031 
00032   /* write pid file */
00033 
00034   /* block signals */
00035   sigset_t mask;
00036   sigemptyset(&mask);
00037   sigaddset(&mask, SIGINT);
00038   sigaddset(&mask, SIGTERM);
00039   sigaddset(&mask, SIGHUP);
00040 
00041   /* all new threads will inherite this signal mask */
00042   pthread_sigmask(SIG_BLOCK, &mask, NULL);
00043   {
00044     /* create the listener */
00045     pthread_t listener_thd_id;
00046     pthread_attr_t listener_thd_attr;
00047 
00048     pthread_attr_init(&listener_thd_attr);
00049     pthread_attr_setdetachstate(&listener_thd_attr, PTHREAD_CREATE_DETACHED);
00050     if (pthread_create(&listener_thd_id, &listener_thd_attr, listener,
00051                        &listener_args))
00052       die("manager(): pthread_create(listener) failed");
00053   }
00054   /*
00055     To work nicely with LinuxThreads, the signal thread is the first thread
00056     in the process.
00057   */
00058   int signo;
00059   my_sigwait(&mask, &signo);
00060   thread_repository.deliver_shutdown();
00061   /* don't pthread_exit to kill all threads who did not shut down in time */
00062 }


Generated on Thu Feb 24 11:01:19 2005 for MySQL by  doxygen 1.3.9.1