1 /* 2 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _KERNEL_USER_MUTEX_H 6 #define _KERNEL_USER_MUTEX_H 7 8 9 #include <SupportDefs.h> 10 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 struct user_mutex_context; 17 18 void user_mutex_init(); 19 void delete_user_mutex_context(struct user_mutex_context* context); 20 21 status_t _user_mutex_lock(int32* mutex, const char* name, uint32 flags, 22 bigtime_t timeout); 23 status_t _user_mutex_unblock(int32* mutex, uint32 flags); 24 status_t _user_mutex_switch_lock(int32* fromMutex, uint32 fromFlags, 25 int32* toMutex, const char* name, uint32 toFlags, bigtime_t timeout); 26 status_t _user_mutex_sem_acquire(int32* sem, const char* name, uint32 flags, 27 bigtime_t timeout); 28 status_t _user_mutex_sem_release(int32* sem, uint32 flags); 29 30 #ifdef __cplusplus 31 } 32 #endif 33 34 35 #endif /* _KERNEL_USER_MUTEX_H */ 36