Files
StarPilot/selfdrive/common/mutex.h
T
Vehicle Researcher 79ca8c9ec9 openpilot release
old-commit-hash: e94a30bec0
2016-11-29 18:34:21 -08: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