apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/locks/win32 thread_mutex.c
Date Thu, 13 Sep 2001 02:50:07 GMT
rbb         01/09/12 19:50:07

  Modified:    locks/win32 thread_mutex.c
  Log:
  Implement apr_thread_mutex_trylock on Windows
  
  Revision  Changes    Path
  1.4       +6 -1      apr/locks/win32/thread_mutex.c
  
  Index: thread_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/win32/thread_mutex.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- thread_mutex.c	2001/09/11 06:29:45	1.3
  +++ thread_mutex.c	2001/09/13 02:50:07	1.4
  @@ -88,7 +88,12 @@
   
   APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex)
   {
  -    return APR_ENOTIMPL;
  +    BOOL status;
  +    status = TryEnterCriticalSection(&mutex->section);
  +    if (status) {
  +        return APR_SUCCESS;
  +    }
  +    return APR_EBUSY;
   }
   
   APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex)
  
  
  

Mime
View raw message