mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
Implement lock_init{_recursive} newlib syscalls
This commit is contained in:
parent
f27685b7b3
commit
03674bba85
@ -5,8 +5,20 @@
|
||||
typedef _LOCK_T Mutex;
|
||||
typedef _LOCK_RECURSIVE_T RMutex;
|
||||
|
||||
static inline void mutexInit(Mutex* m)
|
||||
{
|
||||
*m = 0;
|
||||
}
|
||||
|
||||
void mutexLock(Mutex* m);
|
||||
void mutexUnlock(Mutex* m);
|
||||
|
||||
static inline void rmutexInit(RMutex* m)
|
||||
{
|
||||
m->lock = 0;
|
||||
m->thread_tag = 0;
|
||||
m->counter = 0;
|
||||
}
|
||||
|
||||
void rmutexLock(RMutex* m);
|
||||
void rmutexUnlock(RMutex* m);
|
||||
|
@ -11,8 +11,10 @@ void newlibSetup() {
|
||||
__syscalls.exit = __libnx_exit;
|
||||
|
||||
// Register locking syscalls
|
||||
__syscalls.lock_init = mutexInit;
|
||||
__syscalls.lock_acquire = mutexLock;
|
||||
__syscalls.lock_release = mutexUnlock;
|
||||
__syscalls.lock_init_recursive = rmutexInit;
|
||||
__syscalls.lock_acquire_recursive = rmutexLock;
|
||||
__syscalls.lock_release_recursive = rmutexUnlock;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user