5 #ifndef __CNE_MUTEX_HELPER_H
6 #define __CNE_MUTEX_HELPER_H
33 pthread_mutexattr_t attr;
34 int inited = 0, ret = EFAULT;
46 __do(pthread_mutexattr_init(&attr));
49 __do(pthread_mutexattr_settype(&attr, flags));
51 __do(pthread_mutex_init(mutex, &attr));
53 __do(pthread_mutexattr_destroy(&attr));
61 if (pthread_mutexattr_destroy(&attr))
62 CNE_DEBUG(
"unable to destroy mutex attribute, but is not the root cause\n");
83 ret = pthread_mutex_destroy(mutex);
86 return (ret != 0) ? -1 : 0;
static int cne_mutex_create(pthread_mutex_t *mutex, int flags)
static int cne_mutex_destroy(pthread_mutex_t *mutex)