mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 06:18:39 +00:00
Ensure creating a low priority thread does not assert with SCHED_OTHER policy
This commit is contained in:
@@ -107,7 +107,11 @@ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread {
|
||||
high := posix.sched_get_priority_max(policy)
|
||||
switch priority {
|
||||
case .Normal: // Okay
|
||||
case .Low: params.sched_priority = low + 1
|
||||
case .Low:
|
||||
params.sched_priority = low + 1
|
||||
if params.sched_priority >= high {
|
||||
params.sched_priority = low
|
||||
}
|
||||
case .High: params.sched_priority = high
|
||||
}
|
||||
res = posix.pthread_attr_setschedparam(&attrs, ¶ms)
|
||||
|
||||
Reference in New Issue
Block a user