ams: revamp assertion system
This commit is contained in:
@@ -50,7 +50,7 @@ namespace ams::os {
|
||||
|
||||
NX_INLINE os::ProcessId GetProcessId(::Handle process_handle) {
|
||||
os::ProcessId process_id;
|
||||
R_ASSERT(TryGetProcessId(&process_id, process_handle));
|
||||
R_ABORT_UNLESS(TryGetProcessId(&process_id, process_handle));
|
||||
return process_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace ams::os {
|
||||
}
|
||||
|
||||
void Wait(::Mutex *m) {
|
||||
R_ASSERT(condvarWait(&this->cv, m));
|
||||
R_ABORT_UNLESS(condvarWait(&this->cv, m));
|
||||
}
|
||||
|
||||
ConditionVariableStatus TimedWait(os::Mutex *m, u64 timeout) {
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace ams::os {
|
||||
ManagedHandle(Handle h) : hnd(h) { /* ... */ }
|
||||
~ManagedHandle() {
|
||||
if (this->hnd != INVALID_HANDLE) {
|
||||
R_ASSERT(svcCloseHandle(this->hnd));
|
||||
R_ABORT_UNLESS(svcCloseHandle(this->hnd));
|
||||
this->hnd = INVALID_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace ams::os {
|
||||
constexpr StaticThread() : stack_mem{}, thr{} { /* ... */ }
|
||||
|
||||
constexpr StaticThread(ThreadFunc entry, void *arg, int prio, int cpuid = -2) : StaticThread() {
|
||||
R_ASSERT(this->Initialize(entry, arg, prio, cpuid));
|
||||
R_ABORT_UNLESS(this->Initialize(entry, arg, prio, cpuid));
|
||||
}
|
||||
|
||||
Result Initialize(ThreadFunc entry, void *arg, int prio, int cpuid = -2) {
|
||||
@@ -103,7 +103,7 @@ namespace ams::os {
|
||||
|
||||
NX_INLINE u32 GetCurrentThreadPriority() {
|
||||
u32 prio;
|
||||
R_ASSERT(svcGetThreadPriority(&prio, CUR_THREAD_HANDLE));
|
||||
R_ABORT_UNLESS(svcGetThreadPriority(&prio, CUR_THREAD_HANDLE));
|
||||
return prio;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user