Usermode/libc - Fix strchr and strrchr behavior
[tpg/acess2.git] / Tools / DiskTool / include / mutex.h
1
2 #ifndef _MUTEX_H_
3 #define _MUTEX_H_
4
5 typedef struct {
6         void    *LockerReturnAddr;
7 }       tMutex;
8
9 static inline int Mutex_Acquire(tMutex *m) {
10         if(m->LockerReturnAddr)
11                 Log_KernelPanic("---", "Double mutex lock of %p by %p (was locked by %p)",
12                         m, __builtin_return_address(0), m->LockerReturnAddr);
13         m->LockerReturnAddr = __builtin_return_address(0);;
14         return 0;
15 }
16 static inline void Mutex_Release(tMutex *m) { m->LockerReturnAddr = 0; }
17
18 #endif
19

UCC git Repository :: git.ucc.asn.au