apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: apr/locks/os2 locks.c
Date Sun, 05 Aug 2001 10:15:47 GMT
bjh         01/08/05 03:15:47

  Modified:    locks/os2 locks.c
  Log:
  OS/2: implement apr_lock_tryacquire()
  
  Revision  Changes    Path
  1.34      +15 -3     apr/locks/os2/locks.c
  
  Index: locks.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/os2/locks.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- locks.c	2001/07/19 00:11:57	1.33
  +++ locks.c	2001/08/05 10:15:46	1.34
  @@ -135,13 +135,14 @@
   
   
   
  -apr_status_t apr_lock_acquire(apr_lock_t *lock)
  +// blocks for no more than ms_timeout milliseconds
  +static apr_status_t os2_lock_acquire(apr_lock_t *lock, int ms_timeout)
   {
       ULONG rc;
   
       switch (lock->type) {
       case APR_MUTEX: 
  -        rc = DosRequestMutexSem(lock->hMutex, SEM_INDEFINITE_WAIT);
  +        rc = DosRequestMutexSem(lock->hMutex, ms_timeout);
   
           if (rc == 0) {
               lock->owner = CurrentTid;
  @@ -157,10 +158,21 @@
       return APR_OS2_STATUS(rc);
   }
   
  +
  +
  +apr_status_t apr_lock_acquire(apr_lock_t *lock)
  +{
  +    return os2_lock_acquire(lock, SEM_INDEFINITE_WAIT);
  +}
  +
  +
  +
   apr_status_t apr_lock_tryacquire(apr_lock_t *lock)
   {
  -    return APR_ENOTIMPL;
  +    return os2_lock_acquire(lock, SEM_IMMEDIATE_RETURN);
   }
  +
  +
   
   apr_status_t apr_lock_acquire_rw(apr_lock_t *lock, apr_readerwriter_e e)
   {
  
  
  

Mime
View raw message