6 #ifndef REENTRANT_SYSCALLS_PROVIDED
12 #include "processor.h"
16 int __libogc_lock_init(int *lock
,int recursive
)
19 mutex_t retlck
= LWP_MUTEX_NULL
;
24 ret
= LWP_MutexInit(&retlck
,(recursive
?TRUE
:FALSE
));
25 if(ret
==0) *lock
= (int)retlck
;
30 int __libogc_lock_close(int *lock
)
35 if(!lock
|| *lock
==0) return -1;
37 plock
= (mutex_t
)*lock
;
38 ret
= LWP_MutexDestroy(plock
);
44 int __libogc_lock_acquire(int *lock
)
48 if(!lock
|| *lock
==0) return -1;
50 plock
= (mutex_t
)*lock
;
51 return LWP_MutexLock(plock
);
55 int __libogc_lock_release(int *lock
)
59 if(!lock
|| *lock
==0) return -1;
61 plock
= (mutex_t
)*lock
;
62 return LWP_MutexUnlock(plock
);