fix: reduce cpu utilization at launch
This commit is contained in:
1 parent
5b2edfb84b
commit
5306a4b95c
1 file changed
+2
@@ -48,6 +48,8 @@ class BackgroundThreadWithRunLoop {
|
||||
self.runLoop = CFRunLoopGetCurrent()
|
||||
while !self.thread!.isCancelled {
|
||||
CFRunLoopRun()
|
||||
// avoid tight loop while waiting for the first runloop source to be added
|
||||
Thread.sleep(forTimeInterval: 0.1)
|
||||
}
|
||||
}
|
||||
thread!.name = name
|
||||
|
||||
Reference in new issue
Block a user