Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
Priority
Thread.swift:24enum Priority
Cases
case low
A thread running with lower priority than normally.
case normal
A thread with a standard priority.
case high
A thread running with higher priority than normally.
Other members in extension
Type members
static func setThreadSafetyChecksEnabled(Bool
) Sets whether the thread safety checks the engine normally performs in methods of certain classes (e.g.,
Node
) should happen on the current thread.class var godotClassName: StringName
Instance members
func getId(
) -> String Returns the current
Thread
’s ID, uniquely identifying it among all threads. If theThread
has not started running or ifwaitToFinish
has been called, this returns an empty string.func isAlive(
) -> Bool Returns
true
if thisThread
is currently running the provided function. This is useful for determining ifwaitToFinish
can be called without blocking the calling thread.func isStarted(
) -> Bool Returns
true
if thisThread
has been started. Once started, this will returntrue
until it is joined usingwaitToFinish
. For checking if aThread
is still executing its task, useisAlive
.func start(callable: Callable, priority: Thread.Priority
) -> GodotError Starts a new
Thread
that callscallable
.func waitToFinish(
) -> Variant Joins the
Thread
and waits for it to finish. Returns the output of theCallable
passed tostart(callable:priority:)
.
Citizens in SwiftGodot
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.