refactor: Fix macOS standalone application

This commit is contained in:
世界
2026-01-05 01:21:24 +08:00
parent ef1c924c64
commit 59317f3c79
66 changed files with 2799 additions and 585 deletions
@@ -0,0 +1,28 @@
#if os(macOS)
import Foundation
final class UserServiceEndpointRegistry {
static let shared = UserServiceEndpointRegistry()
private let lock = NSLock()
private var endpoint: NSXPCListenerEndpoint?
func update(_ endpoint: NSXPCListenerEndpoint) {
lock.lock()
self.endpoint = endpoint
lock.unlock()
}
func clear() {
lock.lock()
endpoint = nil
lock.unlock()
}
func get() -> NSXPCListenerEndpoint? {
lock.lock()
defer { lock.unlock() }
return endpoint
}
}
#endif