mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-01 20:28:05 +00:00
41 lines
905 B
Swift
41 lines
905 B
Swift
import Foundation
|
|
import SwiftSignalKit
|
|
|
|
private final class SpinnerThread: NSObject {
|
|
private var thread: Thread?
|
|
private let condition: NSCondition
|
|
private var workValue: CGFloat = 0
|
|
|
|
override init() {
|
|
self.condition = NSCondition()
|
|
|
|
super.init()
|
|
|
|
let thread = Thread(target: self, selector: #selector(self.entryPoint), object: nil)
|
|
thread.name = "Spinner"
|
|
self.thread = thread
|
|
thread.start()
|
|
}
|
|
|
|
@objc func entryPoint() {
|
|
while true {
|
|
workValue = workValue + CGFloat(sin(Double(workValue)))
|
|
usleep(100)
|
|
}
|
|
}
|
|
|
|
func aquire() -> Int {
|
|
return 0
|
|
}
|
|
}
|
|
|
|
//private let atomicSpinner = SpinnerThread()
|
|
|
|
func performanceSpinnerAcquire() -> Int {
|
|
//return atomicSpinner.aquire()
|
|
return 0
|
|
}
|
|
|
|
func performanceSpinnerRelease(_ index: Int) -> Void {
|
|
}
|