Skip to content

Commit 5a611fb

Browse files
authored
Merge pull request #1472 from finagolfin/droid
Android: use the right setpriority() signature for Bionic
2 parents f9c4d86 + 317ea91 commit 5a611fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SKSupport/Process+Run.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private func setProcessPriority(pid: Process.ProcessID, newPriority: TaskPriorit
127127
if !SetPriorityClass(handle, UInt32(newPriority.windowsProcessPriority)) {
128128
logger.error("Failed to set process priority of \(pid) to \(newPriority.rawValue): \(GetLastError())")
129129
}
130-
#elseif canImport(Darwin)
130+
#elseif canImport(Darwin) || canImport(Android)
131131
// `setpriority` is only able to decrease a process's priority and cannot elevate it. Since Swift task’s priorities
132132
// can only be elevated, this means that we can effectively only change a process's priority once, when it is created.
133133
// All subsequent calls to `setpriority` will fail. Because of this, don't log an error.

0 commit comments

Comments
 (0)