Skip to content

Commit bb055c7

Browse files
committed
tuxedo: implement lock_try_acquire(_recursive) syscalls
1 parent d4bf311 commit bb055c7

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tuxedo/newlib_syscalls.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ void __SYSCALL(lock_acquire)(_LOCK_T* lock)
1919
KMutexLock((KMutex*)lock);
2020
}
2121

22+
int __SYSCALL(lock_try_acquire)(_LOCK_T* lock)
23+
{
24+
return KMutexTryLock((KMutex*)lock) ? 0 : 1;
25+
}
26+
2227
void __SYSCALL(lock_release)(_LOCK_T* lock)
2328
{
2429
KMutexUnlock((KMutex*)lock);
@@ -29,6 +34,11 @@ void __SYSCALL(lock_acquire_recursive)(_LOCK_RECURSIVE_T* lock)
2934
KRMutexLock((KRMutex*)lock);
3035
}
3136

37+
int __SYSCALL(lock_try_acquire_recursive)(_LOCK_RECURSIVE_T* lock)
38+
{
39+
return KRMutexTryLock((KRMutex*)lock) ? 0 : 1;
40+
}
41+
3242
void __SYSCALL(lock_release_recursive)(_LOCK_RECURSIVE_T* lock)
3343
{
3444
KRMutexUnlock((KRMutex*)lock);

0 commit comments

Comments
 (0)