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, UIKit for Mac, watchOS, watchOS Simulator, Windows

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

Thread()

 

init()

 

Thread()

 

Sub New()

constructor (ParameterizedThreadStart)

Constructor for thread

 

constructor(aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

 

init(_ aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

 

Sub New(aCallback As ParameterizedThreadStart)

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; }

 

ReadOnly Property CallStack() As String

CurrentThreadID

Returns the current thread id.

 

class property CurrentThreadID: NativeUInt read;

 

class NativeUInt CurrentThreadID { get; }

 

static var CurrentThreadID: NativeUInt { get{} }

 

class NativeUInt CurrentThreadID { __get; }

 

Shared ReadOnly Property CurrentThreadID() As NativeUInt

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)

 

Function Equals(obj As Object) As Boolean

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()

 

Sub 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()

 

Function GetHashCode() As Int32

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

 

Function GetType() As Type

IsAlive

If true this thread is still running.

 

property IsAlive: Boolean read;

 

Boolean IsAlive { get; }

 

var IsAlive: Boolean { get{} }

 

Boolean IsAlive { __get; }

 

ReadOnly Property IsAlive() As Boolean

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; }

 

Property Name() As String

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; }

 

Property Priority() As ThreadPriority

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)

 

Shared Function ReferenceEquals(a As Object, b As Object) As Boolean

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)

 

Shared Sub Sleep(aTimeout As Int32)

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)

 

Sub Start(parameter As Object)

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()

 

Function ToString() As String

Yield

Yield executing till the next cycle this thread gets.

 

class method Yield: Boolean

 

static Boolean Yield()

 

static func Yield() -> Boolean

 

static Boolean Yield()

 

Shared Function Yield() As Boolean

 

CallStack

Exception info when the thread fails.

 

property CallStack: String read;

 

String CallStack { get; }

 

var CallStack: String { get{} }

 

String CallStack { __get; }

 

ReadOnly Property CallStack() As String

IsAlive

If true this thread is still running.

 

property IsAlive: Boolean read;

 

Boolean IsAlive { get; }

 

var IsAlive: Boolean { get{} }

 

Boolean IsAlive { __get; }

 

ReadOnly Property IsAlive() As Boolean

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; }

 

Property Name() As String

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; }

 

Property Priority() As ThreadPriority

CurrentThreadID

Returns the current thread id.

 

class property CurrentThreadID: NativeUInt read;

 

class NativeUInt CurrentThreadID { get; }

 

static var CurrentThreadID: NativeUInt { get{} }

 

class NativeUInt CurrentThreadID { __get; }

 

Shared ReadOnly Property CurrentThreadID() As NativeUInt

 

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)

 

Shared Function ReferenceEquals(a As Object, b As Object) As Boolean

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)

 

Shared Sub Sleep(aTimeout As Int32)

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()

 

Shared Function Yield() As Boolean

 

constructor    (declared in Object)

Default constructor.

 

constructor

 

Thread()

 

init()

 

Thread()

 

Sub New()

constructor (ParameterizedThreadStart)

Constructor for thread

 

constructor(aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

 

init(_ aCallback: ParameterizedThreadStart)

 

Thread(ParameterizedThreadStart aCallback)

 

Sub New(aCallback As ParameterizedThreadStart)

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)

 

Function Equals(obj As Object) As Boolean

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()

 

Sub 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()

 

Function GetHashCode() As Int32

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

 

Function GetType() As Type

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)

 

Sub Start(parameter As Object)

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()

 

Function ToString() As String