|
|
@@ -53,6 +53,22 @@ static inline void pthread_mutex_init_value(pthread_mutex_t *mutex)
|
|
|
*mutex = init_val;
|
|
|
}
|
|
|
|
|
|
+static inline int pthread_mutex_init_recursive(pthread_mutex_t *mutex)
|
|
|
+{
|
|
|
+ pthread_mutexattr_t attr;
|
|
|
+ int ret = pthread_mutexattr_init(&attr);
|
|
|
+ if (ret == 0) {
|
|
|
+ ret = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
|
|
+ if (ret == 0) {
|
|
|
+ ret = pthread_mutex_init(mutex, &attr);
|
|
|
+ }
|
|
|
+
|
|
|
+ pthread_mutexattr_destroy(&attr);
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
enum os_event_type {
|
|
|
OS_EVENT_TYPE_AUTO,
|
|
|
OS_EVENT_TYPE_MANUAL,
|