mirror of
				https://git.suyu.dev/suyu/suyu
				synced 2025-11-04 00:49:02 -06:00 
			
		
		
		
	HLE: Updated various handle debug assertions to be more clear.
This commit is contained in:
		@@ -122,7 +122,7 @@ bool ReleaseMutex(Mutex* mutex) {
 | 
			
		||||
Result ReleaseMutex(Handle handle) {
 | 
			
		||||
    Mutex* mutex = Kernel::g_object_pool.GetFast<Mutex>(handle);
 | 
			
		||||
 | 
			
		||||
    _assert_msg_(KERNEL, mutex, "ReleaseMutex tried to release a NULL mutex!");
 | 
			
		||||
    _assert_msg_(KERNEL, (mutex != NULL), "ReleaseMutex tried to release a NULL mutex!");
 | 
			
		||||
 | 
			
		||||
    if (!ReleaseMutex(mutex)) {
 | 
			
		||||
        return -1;
 | 
			
		||||
 
 | 
			
		||||
@@ -353,7 +353,7 @@ Handle CreateThread(const char* name, u32 entry_point, s32 priority, u32 arg, s3
 | 
			
		||||
/// Get the priority of the thread specified by handle
 | 
			
		||||
u32 GetThreadPriority(const Handle handle) {
 | 
			
		||||
    Thread* thread = g_object_pool.GetFast<Thread>(handle);
 | 
			
		||||
    _assert_msg_(KERNEL, thread, "called, but thread is NULL!");
 | 
			
		||||
    _assert_msg_(KERNEL, (thread != NULL), "called, but thread is NULL!");
 | 
			
		||||
    return thread->current_priority;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -365,7 +365,7 @@ Result SetThreadPriority(Handle handle, s32 priority) {
 | 
			
		||||
    } else {
 | 
			
		||||
        thread = g_object_pool.GetFast<Thread>(handle);
 | 
			
		||||
    }
 | 
			
		||||
    _assert_msg_(KERNEL, thread, "called, but thread is NULL!");
 | 
			
		||||
    _assert_msg_(KERNEL, (thread != NULL), "called, but thread is NULL!");
 | 
			
		||||
 | 
			
		||||
    // If priority is invalid, clamp to valid range
 | 
			
		||||
    if (priority < THREADPRIO_HIGHEST || priority > THREADPRIO_LOWEST) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user