apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/test testprocmutex.c
Date Wed, 20 Nov 2002 05:47:39 GMT
rbb         2002/11/19 21:47:39

  Modified:    test     testprocmutex.c
  Log:
  Call apr_initialize at startup of the child processes.  You cannot have
  an unequal number of apr_terminate and apr_initialize calls.  If you do,
  bad things will happen.  In this case, the bad thing is that if the mutex
  is a semaphore, it will be destroyed before all of the processes die.
  That means that the test will most likely fail.
  
  Revision  Changes    Path
  1.11      +10 -0     apr/test/testprocmutex.c
  
  Index: testprocmutex.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testprocmutex.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- testprocmutex.c	9 Apr 2002 06:45:06 -0000	1.10
  +++ testprocmutex.c	20 Nov 2002 05:47:39 -0000	1.11
  @@ -81,6 +81,16 @@
       apr_sleep (1);
   
       if (apr_proc_fork(*proc, p) == APR_INCHILD) {
  +        /* The parent process has setup all processes to call apr_terminate
  +         * at exit.  But, that means that all processes must also call
  +         * apr_initialize at startup.  You cannot have an unequal number
  +         * of apr_terminate and apr_initialize calls.  If you do, bad things
  +         * will happen.  In this case, the bad thing is that if the mutex
  +         * is a semaphore, it will be destroyed before all of the processes
  +         * die.  That means that the test will most likely fail.
  +         */
  +        apr_initialize();
  +
           while (1) {
               apr_proc_mutex_lock(proc_lock); 
               if (i == MAX_ITER) {
  
  
  

Mime
View raw message