[CRIU] [PATCH 12/14] lock: add futex_inc_and_wake and futex_wait_while_lt

Cyrill Gorcunov gorcunov at openvz.org
Fri Jan 11 04:39:07 EST 2013


On Fri, Jan 11, 2013 at 01:22:43PM +0400, Andrey Vagin wrote:
> 
> Signed-off-by: Andrey Vagin <avagin at openvz.org>
> ---
>  include/lock.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/include/lock.h b/include/lock.h
> index cf976c2..cb3b5b8 100644
> --- a/include/lock.h
> +++ b/include/lock.h
> @@ -70,6 +70,13 @@ static inline void futex_dec_and_wake(futex_t *f)
>  	BUG_ON(sys_futex(&f->raw.counter, FUTEX_WAKE, INT_MAX, NULL, NULL, 0) < 0);
>  }
>  
> +/* Decrement futex @f value and wake up all waiters */
> +static inline void futex_inc_and_wake(futex_t *f)
> +{
> +	atomic_inc(&f->raw);

Decrement? Are you sure? :-)

	Cyrill


More information about the CRIU mailing list