List Info

Thread: PATCH: apr/locks/unix/thread_cond.c




PATCH: apr/locks/unix/thread_cond.c
user name
2007-10-12 13:53:49
pthread_cond_timedwait on zOS returns EAGAIN,  not ETIMEDOUT as on other unix platforms.
Change apr_thread_cond_timedwait to check platform and rv when deciding to return APR_TIMEUP.
I didn't add any config for the zOS rv , as it didn't seem to add anything.

apr/testall testlock  test_timeoutcond will pass with this change, it does not currently.




Index: thread_cond.c
===================================================================
--- thread_cond.c       (revision 579232)
+++ thread_cond.c       (working copy)
-92,7 +92,11
         rv = errno;
     }
 #endif
+#ifdef __MVS__
+    if (EAGAIN == rv) {
+#else
    ; if (ETIMEDOUT == rv) {
+#endif /* __MVS__ */
 ;        return APR_TIMEUP;
     }
     return rv;
  
Re: PATCH: apr/locks/unix/thread_cond.c
country flaguser name
United States
2007-10-12 15:10:46
This looks a little bit dangerous.  Aren't there two
legitimate cases
of EAGAIN?  The timed-out, but also that it was
interrupted?

Is there any way to disambiguate these?

Bill

David Jones wrote:
> pthread_cond_timedwait on zOS returns EAGAIN,  not
ETIMEDOUT as on other 
> unix platforms.
> Change apr_thread_cond_timedwait to check platform and
rv when deciding 
> to return APR_TIMEUP.
> I didn't add any config for the zOS rv , as it didn't
seem to add anything.
> 
> apr/testall testlock  test_timeoutcond will pass with
this change, it 
> does not currently.
> 
> 
> 
> 
> Index: thread_cond.c
>
============================================================
=======
> --- thread_cond.c       (revision 579232)
> +++ thread_cond.c       (working copy)
>  -92,7 +92,11 
>          rv = errno;
>      }
>  #endif
> +#ifdef __MVS__
> +    if (EAGAIN == rv) {
> +#else
>      if (ETIMEDOUT == rv) {
> +#endif /* __MVS__ */
>          return APR_TIMEUP;
>      }
>      return rv;


Re: PATCH: apr/locks/unix/thread_cond.c
user name
2007-10-16 09:58:56
i've added both rc's to the MVS leg. testall/testlock passes.

From the following zOS C/C++ run time manual snippet, looks like this should be enough.

3.563 pthread_cond_timedwait() -- Wait on a Condition Variable



| If unsuccessful, pthread_cond_timedwait() returns -1 and sets errno to one
| of the following values:


| EAGAIN
For a private condition variable, the time specified by abstime
| has passed.


| EINVAL
Can be one of the following error conditions:

  • | The value specified by cond is not valid.
  • | The value specified by mutex is not valid.
  • | The value specified by abstime (tv_sec) is not valid.
  • | The value specified by abstime (tv_nsec) is not valid.
  • | Different mutexes were specified for concurrent operations
    | on the same condition variable.
  • | The mutex is not owned by the current thread.


| ETIMEDOUT
For a shared condition variable, the time specified by abstime
| has passed.


Index: locks/unix/thread_cond.c
===================================================================
--- locks/unix/thread_cond.c    (revision 579232)
+++ locks/unix/thread_cond.c    (working copy)
-92,7 +92,11
         rv = errno;
     }
 #endif
+#ifdef __MVS__
+    if (ETIMEDOUT == rv || EAGAIN == rv) {
+#else
    ; if (ETIMEDOUT == rv) {
+#endif /* __MVS__ */
     ;    return APR_TIMEUP;
     }
     return rv;



On 10/12/07, William A. Rowe, Jr. < wrowerowe-clan.net">wrowerowe-clan.net> wrote:
This looks a little bit dangerous.  ;Aren't there two legitimate cases
of EAGAIN?&nbsp; The timed-out, but also that it was interrupted?

Is there any way to disambiguate these?

Bill

David Jones wrote:
&gt; pthread_cond_timedwait on zOS returns EAGAIN,&nbsp; not ETIMEDOUT as on other
> unix platforms.
> Change apr_thread_cond_timedwait to check platform and rv when deciding
&gt; to return APR_TIMEUP.
> I didn't add any config for the zOS rv , as it didn't seem to add anything.
>
> apr/testall testlock&nbsp; test_timeoutcond will pass with this change, it
> does not currently.
>
>
>
>
&gt; Index: thread_cond.c
> ===================================================================
> --- thread_cond.c &nbsp; &nbsp;   (revision 579232)
&gt; +++ thread_cond.c &nbsp; &nbsp;   (working copy)
> -92,7 +92,11
; &nbsp; &nbsp; &nbsp; &nbsp; rv = errno;
>; &nbsp; &nbsp; &nbsp;}
>&nbsp; #endif
> +#ifdef __MVS__
&gt; + &nbsp; &nbsp;if (EAGAIN == rv) {
> +#else
>; &nbsp; &nbsp; &nbsp;if (ETIMEDOUT == rv) {
> +#endif /* __MVS__ */
>&nbsp; &nbsp; &nbsp;   ; &nbsp;return APR_TIMEUP;
; &nbsp; &nbsp; }
> &nbsp;   ; return rv;


  
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )