This is the mail archive of the mailing list for the pthreads-win32 project. See the pthreads-win32 home page for more information.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: CancelableWait in misc.c should check for negative timeout

Hi Tor,

On Thu, 25 Mar 1999, Tor Lillqvist wrote:

> Tor Lillqvist writes:
>  >   if (((int) timeout) < 0)
>  >     timeout = 0;
> Actually, as INFINITE is 0xFFFFFFFF, i.e. -1, this code snippet
> shouldn't be in CancelableWait, but in pthreadCancelableTimedWait.

I'm thinking that the check should go in _pthread_sem_timedwait
which does the conversion from an abstime value to milliseconds.

pthreadCancelableTimedWait is called by _pthread_sem_timedwait which
is called by pthread_cond_timedwait.

The reason is: I think that the millisecond timeout argument for
pthreadCancelableTimedWait should behave the same as for


| Ross Johnson         |   | E-Mail:
| Info Sciences and Eng|___|
| University of Canberra   | FAX:    +61 6 2015227
| PO Box 1                 |
| Belconnen  ACT    2616   | WWW:
| AUSTRALIA                |