[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apr-cvs
Subject:    cvs commit: apr/threadproc/win32 thread.c
From:       stoddard () apache ! org
Date:       2003-06-18 19:00:41
[Download RAW message or body]

stoddard    2003/06/18 12:00:41

  Modified:    threadproc/win32 thread.c
  Log:
  Win32: WAIT_ABANDONED should be treated as a success. WAIT_FAILED (the only
  other possible return code) should call GetLastError, canonicalize it then
  return that as apr_status
  
  Revision  Changes    Path
  1.53      +5 -5      apr/threadproc/win32/thread.c
  
  Index: thread.c
  ===================================================================
  RCS file: /home/cvs/apr/threadproc/win32/thread.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- thread.c	6 Jan 2003 23:44:39 -0000	1.52
  +++ thread.c	18 Jun 2003 19:00:41 -0000	1.53
  @@ -167,15 +167,15 @@
   APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
                                             apr_thread_t *thd)
   {
  -    apr_status_t stat;
  +    apr_status_t rv;
   
  -    if ((stat = WaitForSingleObject(thd->td, INFINITE)) == WAIT_OBJECT_0) {
  +    rv = WaitForSingleObject(thd->td, INFINITE);
  +    if ( rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) {
           *retval = thd->exitval;
           return APR_SUCCESS;
       }
  -    else {
  -        return stat;
  -    }
  +    /* Wait failed */
  +    return APR_FROM_OS_ERROR(GetLastError());
   }
   
   APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)
  
  
  
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic