Files
dragonpilot/selfdrive/common/mutex.h
Vehicle Researcher 8a9ed94f5f openpilot v0.6 release
2019-06-28 21:11:30 +00:00

14 lines
303 B
C

#ifndef COMMON_MUTEX_H
#define COMMON_MUTEX_H
#include <pthread.h>
static inline void mutex_init_reentrant(pthread_mutex_t *mutex) {
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(mutex, &attr);
}
#endif