Re: [PATCH -mm] update comment in rtmutex.c and friends

From: Thomas Gleixner
Date: Sat May 13 2006 - 19:36:02 EST


On Sat, 2006-05-13 at 19:34 -0400, Steven Rostedt wrote:
> The documented state in both the code and the rt-mutex.txt has a slight
> incorrect statement. They state that if the owner of the mutex is NULL,
> and the "mutex has waiters" bit is set that it is an invalid state.
>
> This is not true. To synchronize with an owner releasing the mutex, the
> owner field must have the "mutex has waiters" bit set before trying to
> grab the lock. This prevents the owner from releasing the lock without going
> into the slow unlock path. But if the mutex doesn't have an owner, then
> before the current process grabs the lock, it sets the "mutex has waiters"
> bit. But in this case it will grab the lock and clear the bit. So the
> "mutex has waiters" bit and owner == NULL is a transitional state.
>
> This patch comments this case.
>
> -- Steve
>
>
> Signed-off-by: Steven Rostedt <rostedt@xxxxxxxxxxx>

Acked-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/