src/dpdk/drivers/net/failsafe/failsafe_private.h
static inline int
fs_lock(struct rte_eth_dev *dev, unsigned int is_alarm)
{
	int ret;

	if (is_alarm) {
		ret = pthread_mutex_trylock(&PRIV(dev)->hotplug_mutex);
		if (ret) {
			DEBUG("Hot-plug mutex lock trying failed(%s), will try"
			      " again later...", strerror(ret));
			return ret;
		}
		PRIV(dev)->alarm_lock = 1;
	} else {
		ret = pthread_mutex_lock(&PRIV(dev)->hotplug_mutex);
		if (ret) {
			ERROR("Cannot lock mutex(%s)", strerror(ret));
			return ret;
		}
	}
	return ret;
}
/*
 * Lock hot-plug mutex.
 * is_alarm means that the caller is, for sure, the hot-plug alarm mechanism.
 */
Lock hot-plug mutex.
is_alarm means that the caller is, for sure, the hot-plug alarm mechanism.
Lock hot - plug mutex . is_alarm means that the caller is for sure the hot - plug alarm mechanism .
static inline int
fs_lock(struct rte_eth_dev *dev, unsigned int is_alarm)
{
	int ret;
	if (is_alarm) {
		ret = pthread_mutex_trylock(&PRIV(dev)->hotplug_mutex);
		if (ret) {
			DEBUG("Hot-plug mutex lock trying failed(%s), will try"
			      " again later...", strerror(ret));
			return ret;
		}
		PRIV(dev)->alarm_lock = 1;
	} else {
		ret = pthread_mutex_lock(&PRIV(dev)->hotplug_mutex);
		if (ret) {
			ERROR("Cannot lock mutex(%s)", strerror(ret));
			return ret;
		}
	}
	return ret;
}
static inline int fs_lock ( struct rte_eth_dev * dev , unsigned int is_alarm ) { int ret ; if ( is_alarm ) { ret = pthread_mutex_trylock ( & PRIV ( dev ) -> hotplug_mutex ) ; if ( ret ) { DEBUG ( " " " " , strerror ( ret ) ) ; return ret ; } PRIV ( dev ) -> alarm_lock = 1 ; } else { ret = pthread_mutex_lock ( & PRIV ( dev ) -> hotplug_mutex ) ; if ( ret ) { ERROR ( " " , strerror ( ret ) ) ; return ret ; } } return ret ; }
Lock hot-plug mutex.
Lock hot - plug mutex .