Re: [PATCH 02/35] libmultipath: add trylock() helper

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

 



On Fri, Sep 10, 2021 at 01:40:47PM +0200, mwilck@xxxxxxxx wrote:
> From: Martin Wilck <mwilck@xxxxxxxx>
> 
> Add a small helper.
> 
> Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
Reviewed-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> ---
>  libmultipath/lock.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libmultipath/lock.h b/libmultipath/lock.h
> index a170efe..d99eedb 100644
> --- a/libmultipath/lock.h
> +++ b/libmultipath/lock.h
> @@ -12,6 +12,11 @@ static inline void lock(struct mutex_lock *a)
>  	pthread_mutex_lock(&a->mutex);
>  }
>  
> +static inline int trylock(struct mutex_lock *a)
> +{
> +	return pthread_mutex_trylock(&a->mutex);
> +}
> +
>  static inline int timedlock(struct mutex_lock *a, struct timespec *tmo)
>  {
>  	return pthread_mutex_timedlock(&a->mutex, tmo);
> -- 
> 2.33.0

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux