mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 23:02:47 +01:00
thread: added correct lowest thread priority, added a thread priority check, and added some comments
This commit is contained in:
parent
bed4e920fa
commit
203541da11
2 changed files with 10 additions and 6 deletions
|
@ -223,6 +223,9 @@ void ResumeThreadFromWait(Handle handle) {
|
||||||
Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority,
|
Thread* CreateThread(Handle& handle, const char* name, u32 entry_point, s32 priority,
|
||||||
s32 processor_id, u32 stack_top, int stack_size) {
|
s32 processor_id, u32 stack_top, int stack_size) {
|
||||||
|
|
||||||
|
_assert_msg_(KERNEL, (priority >= THREADPRIO_HIGHEST && priority <= THREADPRIO_LOWEST),
|
||||||
|
"CreateThread priority=%d, outside of allowable range!", priority)
|
||||||
|
|
||||||
Thread* t = new Thread;
|
Thread* t = new Thread;
|
||||||
|
|
||||||
handle = Kernel::g_object_pool.Create(t);
|
handle = Kernel::g_object_pool.Create(t);
|
||||||
|
|
|
@ -8,15 +8,16 @@
|
||||||
#include "core/hle/kernel/kernel.h"
|
#include "core/hle/kernel/kernel.h"
|
||||||
|
|
||||||
enum ThreadPriority {
|
enum ThreadPriority {
|
||||||
THREADPRIO_HIGHEST = 0,
|
THREADPRIO_HIGHEST = 0, ///< Highest thread priority
|
||||||
THREADPRIO_DEFAULT = 16,
|
THREADPRIO_DEFAULT = 16, ///< Default thread priority for userland apps
|
||||||
THREADPRIO_LOWEST = 31,
|
THREADPRIO_LOW = 31, ///< Low range of thread priority for userland apps
|
||||||
|
THREADPRIO_LOWEST = 63, ///< Thread priority max checked by svcCreateThread
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ThreadProcessorId {
|
enum ThreadProcessorId {
|
||||||
THREADPROCESSORID_0 = 0xFFFFFFFE,
|
THREADPROCESSORID_0 = 0xFFFFFFFE, ///< Enables core appcode
|
||||||
THREADPROCESSORID_1 = 0xFFFFFFFD,
|
THREADPROCESSORID_1 = 0xFFFFFFFD, ///< Enables core syscore
|
||||||
THREADPROCESSORID_ALL = 0xFFFFFFFC,
|
THREADPROCESSORID_ALL = 0xFFFFFFFC, ///< Enables both cores
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
Loading…
Reference in a new issue