httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/mpmt_pthread mpmt_pthread.c
Date Tue, 16 May 2000 17:48:58 GMT
trawick     00/05/16 10:48:58

  Modified:    src/lib/apr hints.m4
               src/lib/apr/threadproc/unix thread.c
               src/modules/mpm/mpmt_pthread mpmt_pthread.c
  Log:
  Handle some OS/390-isms dealing with pthreads:
  . the types of the parameters to pthread_attr_setdetachstate()
    and pthread_detach()
  . the fact that sigprocmask() must be use to set a thread's
    signal mask
  
  Revision  Changes    Path
  1.6       +3 -0      apache-2.0/src/lib/apr/hints.m4
  
  Index: hints.m4
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/hints.m4,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- hints.m4	2000/05/10 00:15:25	1.5
  +++ hints.m4	2000/05/16 17:48:56	1.6
  @@ -365,6 +365,9 @@
       *-ibm-os390)
          APR_SETIFNULL(CC, cc)
          APR_ADDTO(CFLAGS, -U_NO_PROTO)
  +       APR_ADDTO(CFLAGS, -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR)
  +       APR_ADDTO(CFLAGS, -DPTHREAD_DETACH_ARG1_ADDR)
  +       APR_ADDTO(CFLAGS, -DSIGPROCMASK_SETS_THREAD_MASK)
          ;;
   esac
   APR_DOEXTRA
  
  
  
  1.22      +10 -0     apache-2.0/src/lib/apr/threadproc/unix/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/unix/thread.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- thread.c	2000/05/07 01:47:08	1.21
  +++ thread.c	2000/05/16 17:48:57	1.22
  @@ -81,7 +81,13 @@
   ap_status_t ap_setthreadattr_detach(ap_threadattr_t *attr, ap_int32_t on)
   {
       ap_status_t stat;
  +#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR
  +    int arg = on;
  +
  +    if ((stat = pthread_attr_setdetachstate(attr->attr, &arg)) == 0) {
  +#else
       if ((stat = pthread_attr_setdetachstate(attr->attr, on)) == 0) {
  +#endif
           return APR_SUCCESS;
       }
       else {
  @@ -165,7 +171,11 @@
   {
       ap_status_t stat;
   
  +#ifdef PTHREAD_DETACH_ARG1_ADDR
  +    if ((stat = pthread_detach(thd->td)) == 0) {
  +#else
       if ((stat = pthread_detach(*thd->td)) == 0) {
  +#endif
           return APR_SUCCESS;
       }
       else {
  
  
  
  1.70      +14 -0     apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c
  
  Index: mpmt_pthread.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/mpmt_pthread/mpmt_pthread.c,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- mpmt_pthread.c	2000/05/11 21:16:57	1.69
  +++ mpmt_pthread.c	2000/05/16 17:48:58	1.70
  @@ -837,9 +837,15 @@
       /* All threads should mask signals out, accoring to sigwait(2) man page */
       sigfillset(&sig_mask);
   
  +#ifdef SIGPROCMASK_SETS_THREAD_MASK
  +    if (sigprocmask(SIG_SETMASK, &sig_mask, NULL) != 0) {
  +        ap_log_error(APLOG_MARK, APLOG_ALERT, errno, server_conf, "sigprocmask");
  +    }
  +#else
       if (pthread_sigmask(SIG_SETMASK, &sig_mask, NULL) != 0) {
           ap_log_error(APLOG_MARK, APLOG_ALERT, errno, server_conf, "pthread_sigmask");
       }
  +#endif
   
       requests_this_child = ap_max_requests_per_child;
       
  @@ -857,7 +863,15 @@
       pthread_mutex_init(&worker_thread_count_mutex, NULL);
       pthread_mutex_init(&pipe_of_death_mutex, NULL);
       pthread_attr_init(&thread_attr);
  +#ifdef PTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR
  +    {
  +        int on = 1;
  +
  +        pthread_attr_setdetachstate(&thread_attr, &on);
  +    }
  +#else
       pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_DETACHED);
  +#endif
       for (i=0; i < ap_threads_per_child; i++) {
   
   	my_info = (proc_info *)malloc(sizeof(proc_info));
  
  
  

Mime
View raw message