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

atomic_t * cnt

the atomic which we are to dec

struct mutex * 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