apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: apr/locks/unix proc_mutex.c thread_cond.c
Date Sun, 30 Jun 2002 04:04:43 GMT
brianp      2002/06/29 21:04:43

  Modified:    locks/unix proc_mutex.c thread_cond.c
  Log:
  Replaced APR_USEC_PER_SEC division with the new apr_time_sec() macro
  
  Revision  Changes    Path
  1.19      +3 -1      apr/locks/unix/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- proc_mutex.c	7 Jun 2002 14:04:34 -0000	1.18
  +++ proc_mutex.c	30 Jun 2002 04:04:42 -0000	1.19
  @@ -86,6 +86,7 @@
       sem_t *psem;
       apr_status_t stat;
       char semname[14];
  +    apr_time_t now;
       unsigned long epoch;
       
       new_mutex->interproc = apr_palloc(new_mutex->pool,
  @@ -107,7 +108,8 @@
        * the sem_open and the sem_unlink. Use of O_EXCL does not
        * help here however...
        */
  -    epoch = apr_time_now() / APR_USEC_PER_SEC;
  +    now = apr_time_now();
  +    epoch = apr_time_sec(now);
       apr_snprintf(semname, sizeof(semname), "/ApR.%lx", epoch);
       psem = sem_open((const char *) semname, O_CREAT, 0644, 1);
   
  
  
  
  1.7       +2 -2      apr/locks/unix/thread_cond.c
  
  Index: thread_cond.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/thread_cond.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- thread_cond.c	13 Mar 2002 20:39:21 -0000	1.6
  +++ thread_cond.c	30 Jun 2002 04:04:42 -0000	1.7
  @@ -133,8 +133,8 @@
       struct timespec abstime;
   
       then = apr_time_now() + timeout;
  -    abstime.tv_sec = then / APR_USEC_PER_SEC;
  -    abstime.tv_nsec = (then % APR_USEC_PER_SEC) * 1000; /* nanoseconds */
  +    abstime.tv_sec = apr_time_sec(then);
  +    abstime.tv_nsec = apr_time_usec(then) * 1000; /* nanoseconds */
   
       rv = pthread_cond_timedwait(cond->cond, &mutex->mutex, &abstime);
   #ifdef PTHREAD_SETS_ERRNO
  
  
  

Mime
View raw message