SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Platform::Thread
Class IRunnable

NonCopyableType
   |
   +-IRunnable

Implemented in:
Platform.Thread.IRunnable.h

abstract class IRunnable:
private NonCopyableType

Represents the runnable interface. This is an abstract class which cannot be instantiated on its own.

A type implementing the runnable interface represents the actual code that will run in a new execution thread.

See Also:
Thread::Task, Thread

Constructor Summarycollapse
~IRunnable() = 0
          Destroys this runnable.

Method Summarycollapse
Void run() = 0
          The entry point of a new thread.

 

Constructor Detail

~IRunnable[abstract]

~IRunnable() = 0

Destroys this runnable.

Any pending interrupts sent to this runnable are destroyed and lost.

It is an error to destroy a runnable object while the thread is still running. If a runnable's destructor is invoked prior to the run method returning the platform will signal a run-time error Error_Thread_PrematureRunnableDtor causing immediate termination of the program.

See Also:
Runtime::Error_Thread_PrematureRunnableDtor

 

Method Detail

run[abstract]

Void run() = 0

The entry point of a new thread. Types implementing runnable interface must override this method providing the actual implementation of a thread's functionality.

This method is ivoked in a new execution thread as soon as a Task object targeting this runnable instance is created in the parent thread. If the logic requires the new thread to start in suspended (blocked) state this method should call the Thread::sleep method. When the parent thread decides to wake up this runnable it can send an interrupt signal through the task object.

See Also:
Thread::sleep, Task::interrupt, Task


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND