Thread

Overview

Island Thread class, used to run code in parallel

Location

  • Reference: Island.fx
  • Namespace: RemObjects.Elements.System
  • Platforms: Android, iOS, iOS Simulator, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, Windows

 

constructor    (declared in Object)

Default constructor.

 

constructor()

 

Thread()

 

init()

 

Thread()

constructor (ParameterizedThreadStart)

Constructor for thread

 

constructor(aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

 

init(_ aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

Parameters:

  • aCallback: The callback to call when this thread runs

CallStack

Exception info when the thread fails.

 

property CallStack: String read

 

String CallStack { get; }

 

var CallStack: String { get{} }

 

String CallStack { __get; }

CurrentThreadID

Returns the current thread id.

 

class property CurrentThreadID: NativeUInt read

 

class NativeUInt CurrentThreadID { get; }

 

static var CurrentThreadID: NativeUInt { get{} }

 

class NativeUInt CurrentThreadID { __get; }

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize()

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode(): Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType(): Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

IsAlive

If true this thread is still running.

 

property IsAlive: Boolean read

 

Boolean IsAlive { get; }

 

var IsAlive: Boolean { get{} }

 

Boolean IsAlive { __get; }

Name

gets/sets the name of this thread.

 

property Name: String read write

 

String Name { get; set; }

 

var Name: String { get{} set{} }

 

String Name { __get; __set; }

Priority

Set the thread's priority; note that on Posix this requires root for higher than normal priority.

 

property Priority: ThreadPriority read write

 

ThreadPriority Priority { get; set; }

 

var Priority: ThreadPriority { get{} set{} }

 

ThreadPriority Priority { __get; __set; }

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

Sleep

Pause the current thread for a given amount of msec.

 

class method Sleep(aTimeout: Int32)

 

static void Sleep(Int32 aTimeout)

 

static func Sleep(_ aTimeout: Int32)

 

static void Sleep(Int32 aTimeout)

Parameters:

  • aTimeout: Time to wait in msec.

Start

Starts the thread; passing parameter to the callback.

 

method Start(parameter: Object)

 

void Start(Object parameter)

 

func Start(_ parameter: Object)

 

void Start(Object parameter)

Parameters:

  • parameter: The parameter to pass to the callback

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString(): String

 

String ToString()

 

func ToString() -> String

 

String ToString()

Yield

Yield executing till the next cycle this thread gets.

 

class method Yield(): Boolean

 

static Boolean Yield()

 

static func Yield() -> Boolean

 

static Boolean Yield()

 

CallStack

Exception info when the thread fails.

 

property CallStack: String read

 

String CallStack { get; }

 

var CallStack: String { get{} }

 

String CallStack { __get; }

IsAlive

If true this thread is still running.

 

property IsAlive: Boolean read

 

Boolean IsAlive { get; }

 

var IsAlive: Boolean { get{} }

 

Boolean IsAlive { __get; }

Name

gets/sets the name of this thread.

 

property Name: String read write

 

String Name { get; set; }

 

var Name: String { get{} set{} }

 

String Name { __get; __set; }

Priority

Set the thread's priority; note that on Posix this requires root for higher than normal priority.

 

property Priority: ThreadPriority read write

 

ThreadPriority Priority { get; set; }

 

var Priority: ThreadPriority { get{} set{} }

 

ThreadPriority Priority { __get; __set; }

CurrentThreadID

Returns the current thread id.

 

class property CurrentThreadID: NativeUInt read

 

class NativeUInt CurrentThreadID { get; }

 

static var CurrentThreadID: NativeUInt { get{} }

 

class NativeUInt CurrentThreadID { __get; }

 

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

Parameters:

  • a: left value
  • b: right value

Sleep

Pause the current thread for a given amount of msec.

 

class method Sleep(aTimeout: Int32)

 

static void Sleep(Int32 aTimeout)

 

static func Sleep(_ aTimeout: Int32)

 

static void Sleep(Int32 aTimeout)

Parameters:

  • aTimeout: Time to wait in msec.

Yield

Yield executing till the next cycle this thread gets.

 

class method Yield(): Boolean

 

static Boolean Yield()

 

static func Yield() -> Boolean

 

static Boolean Yield()

 

constructor    (declared in Object)

Default constructor.

 

constructor()

 

Thread()

 

init()

 

Thread()

constructor (ParameterizedThreadStart)

Constructor for thread

 

constructor(aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

 

init(_ aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

Parameters:

  • aCallback: The callback to call when this thread runs

Equals  virtual    (declared in Object)

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object)

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize()

 

void Finalize()

 

func Finalize()

 

void Finalize()

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode(): Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType(): Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

Start

Starts the thread; passing parameter to the callback.

 

method Start(parameter: Object)

 

void Start(Object parameter)

 

func Start(_ parameter: Object)

 

void Start(Object parameter)

Parameters:

  • parameter: The parameter to pass to the callback

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString(): String

 

String ToString()

 

func ToString() -> String

 

String ToString()