[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

maybe a bug in spinlock



Yu Chen wrote:
> hi, Joel
>
> my student and I consider
>
> line 75 in corespinlockwait.c
>
> if ( timeout && (limit >= _Watchdog_Ticks_since_boot)) {
>
> should be
>
> if ( timeout && (limit < _Watchdog_Ticks_since_boot)) {
>
>
>
> How do you think of it?
>
>   
I think you are right.  It should be <= though.

Thanks for spotting and reporting this.

FWIW this code is new on the CVS head and this
particular path is not supported by POSIX.  You
can't timeout on a POSIX spinlock.  I was hoping
to implement a Classic API spinlock eventually
which did support timeouts.

--joel