From fa60fa8c40c324d75967f0289b4ef2accb65fceb Mon Sep 17 00:00:00 2001 From: John Connolly Date: Mon, 5 Mar 2018 11:12:23 -0400 Subject: [PATCH] Change class func to static on Thread. (#101) Motivation: Thread is declared final, so I believe spawnAndRun should be static. Modifications: Change class func to static Result: More consistent code, and spawnAndRun is statically dispatched. --- Sources/NIO/Thread.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/NIO/Thread.swift b/Sources/NIO/Thread.swift index 50dc936b9..5c0116410 100644 --- a/Sources/NIO/Thread.swift +++ b/Sources/NIO/Thread.swift @@ -76,7 +76,7 @@ final class Thread { /// - arguments: /// - name: The name of the `Thread` or `nil` if no specific name should be set. /// - body: The function to execute within the spawned `Thread`. - class func spawnAndRun(name: String? = nil, body: @escaping (Thread) -> Void) { + static func spawnAndRun(name: String? = nil, body: @escaping (Thread) -> Void) { // Unfortunally the pthread_create method take a different first argument depending on if its on linux or macOS, so ensure we use the correct one. #if os(Linux) var pt: pthread_t = pthread_t()