fix: Resolve gpsd deadlock causing GPS connect to hang

start_gpsd_daemon() acquires _gpsd_process_lock then calls
stop_gpsd_daemon() which tries to acquire the same non-reentrant Lock,
causing an immediate deadlock. Changed to RLock so the same thread can
re-enter the lock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-02-16 15:38:00 +00:00
parent 99d52eafe7
commit c0498ebe68

View File

@@ -490,7 +490,7 @@ def get_current_position() -> GPSPosition | None:
# ============================================
_gpsd_process: 'subprocess.Popen | None' = None
_gpsd_process_lock = threading.Lock()
_gpsd_process_lock = threading.RLock()
def detect_gps_devices() -> list[dict]: