MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fs_mutex_init

Function fs_mutex_init

dpdk/drivers/net/failsafe/failsafe.c:133–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133static int
134fs_mutex_init(struct fs_priv *priv)
135{
136 int ret;
137 pthread_mutexattr_t attr;
138
139 ret = pthread_mutexattr_init(&attr);
140 if (ret) {
141 ERROR("Cannot initiate mutex attributes - %s", strerror(ret));
142 return ret;
143 }
144 /* Allow mutex relocks for the thread holding the mutex. */
145 ret = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
146 if (ret) {
147 ERROR("Cannot set mutex type - %s", strerror(ret));
148 return ret;
149 }
150 ret = pthread_mutex_init(&priv->hotplug_mutex, &attr);
151 if (ret) {
152 ERROR("Cannot initiate mutex - %s", strerror(ret));
153 return ret;
154 }
155 return 0;
156}
157
158static int
159fs_eth_dev_create(struct rte_vdev_device *vdev)

Callers 1

fs_eth_dev_createFunction · 0.85

Calls 1

pthread_mutex_initFunction · 0.85

Tested by

no test coverage detected