mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-11 04:12:07 +08:00
Mypy: Got passing on macos (#34591)
* Mypy: Got mypy passing on macos * common/realtime.py refactor * Mypy: mypy passing on darwin * Refactor: Removed else: pass statement * Refactor: Removed unnecessary check * added xattr to pyproject * loggerd: switched to xatter module * loggerd: removed unused module in xattr_cache.py * UV: update uv.lock * Update system/athena/athenad.py Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com> * athenad: fixed blank lines * loggerd: refactor of xattr_cache * cleanup --------- Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
This commit is contained in:
+3
-2
@@ -1,6 +1,7 @@
|
||||
"""Utilities for reading real time clocks and keeping soft real time constraints."""
|
||||
import gc
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from collections import deque
|
||||
|
||||
@@ -28,13 +29,13 @@ class Priority:
|
||||
|
||||
|
||||
def set_core_affinity(cores: list[int]) -> None:
|
||||
if not PC:
|
||||
if sys.platform == 'linux' and not PC:
|
||||
os.sched_setaffinity(0, cores)
|
||||
|
||||
|
||||
def config_realtime_process(cores: int | list[int], priority: int) -> None:
|
||||
gc.disable()
|
||||
if not PC:
|
||||
if sys.platform == 'linux' and not PC:
|
||||
os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(priority))
|
||||
c = cores if isinstance(cores, list) else [cores, ]
|
||||
set_core_affinity(c)
|
||||
|
||||
Reference in New Issue
Block a user