apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Khon <f...@samodelkin.net>
Subject Re: Some pending pathches for review/commit
Date Sun, 19 Sep 2004 16:32:19 GMT
Hi!

On Sun, Sep 19, 2004 at 05:47:48PM +0200, Mladen Turk wrote:

>  APR_DECLARE(apr_status_t) apr_thread_join(apr_status_t *retval,
>                                            apr_thread_t *thd)
>  {
> -    apr_status_t rv;
> -
> +    apr_status_t rv = APR_SUCCESS;
> +
> +    if (!thd->td) {
> +        /* Can not join on detached threads */
> +        return APR_DETACH;
> +    }
>      rv = WaitForSingleObject(thd->td, INFINITE);
>      if ( rv == WAIT_OBJECT_0 || rv == WAIT_ABANDONED) {
>          *retval = thd->exitval;
> -        return APR_SUCCESS;

  +        rv = APR_SUCCESS;

>      }
> -    /* Wait failed */
> -    return apr_get_os_error();;
> +    else
> +        rv = apr_get_os_error();
> +    CloseHandle(thd->td);
> +    thd->td = NULL;
> +
> +    return rv;
>  }
> 
>  APR_DECLARE(apr_status_t) apr_thread_detach(apr_thread_t *thd)

/fjoe

Mime
View raw message