Files
ShadowsocksX-NG/Legacy/Pods/RxSwift/Platform/Platform.Linux.swift
T
Qiu Yuzhou 3a62f473bc chore: restructure repo for modern reimplementation
- Remove GitHub Actions workflows and issue templates
- Move legacy ShadowsocksX-NG project into Legacy/
- Remove git submodules; dependencies will use prebuilt
  binaries copied from upstream releases instead of
  building in-repo
- Add ShadowsocksX-NG2/ directory for the new project
- Update .gitignore paths for the new layout
2026-09-19 22:31:37 +08:00

33 lines
804 B
Swift

//
// Platform.Linux.swift
// Platform
//
// Created by Krunoslav Zaher on 12/29/15.
// Copyright © 2015 Krunoslav Zaher. All rights reserved.
//
#if os(Linux)
import Foundation
extension Thread {
static func setThreadLocalStorageValue<T: AnyObject>(_ value: T?, forKey key: String) {
if let newValue = value {
Thread.current.threadDictionary[key] = newValue
}
else {
Thread.current.threadDictionary[key] = nil
}
}
static func getThreadLocalStorageValueForKey<T: AnyObject>(_ key: String) -> T? {
let currentThread = Thread.current
let threadDictionary = currentThread.threadDictionary
return threadDictionary[key] as? T
}
}
#endif