ATOMIC_DEC_AND_MUTEX

Section: Mutex API reference (9)
Updated: February 2011
Index Return to Main Contents
 

NAME

atomic_dec_and_mutex_lock - return holding mutex if we dec to 0  

SYNOPSIS

int atomic_dec_and_mutex_lock(atomic_t * cnt, struct mutex * lock);
 

ARGUMENTS

cnt

the atomic which we are to dec

lock

the mutex to return holding if we dec to 0
 

DESCRIPTION

return true and hold lock if we dec to 0, return false otherwise  

AUTHOR

Rusty Russell <rusty@rustcorp.com.au>

Author.
 

COPYRIGHT