home
 
 index of namespace default
 
 index of project core
 
 index of module core

Class core.Thread


SynopsisRepresents a simultaneously running program task.  

  Base classes:
  Methods:
  Constants: Description:


A thread may run on a different processor (if available).
Each thread has a mailbox that can be used to receive messages from other threads.

See also:  


 
 top of page
Method allocEventQueue
Allocate mailbox event queue/ring buffer.
Signature
allocEventQueue(intsize)
Arguments
intsizeMaximum number of events that can be posted without discarding old events.

 
 top of page
Method create
Signature
create(FunctionentryFunction)
 :boolean
Arguments
FunctionentryFunctionFunction object to be used for thread startup. The arbitrary user argument can be accessed by using the Thread.getUserData() getter function.
Returns
boolean

 
 top of page
Method getId
Signature
getId():int
Returns
int

 
 top of page
Method getName
Signature
getName():String
Returns
String

 
 top of page
Method getPriority
Signature
getPriority():int
Returns
int

 
 top of page
Method getUserData
Signature
getUserData():Object
Returns
Object

 
 top of page
Method isRunning
Signature
isRunning():boolean
Returns
boolean

 
 top of page
Method kill
Signature
kill()

 
 top of page
Method peekEvent
Return next pending event without removing it from the queue.
Signature
peekEvent():Event
Returns
EventPending event or null

 
 top of page
Method peekEventById
Return next pending event whose id matches "id" without removing it from the queue.
Signature
peekEventById(intid)
 :Event
Arguments
intid
Returns
EventPending event or null

 
 top of page
Method sendEvent
Post new message in mailbox.
Signature
sendEvent(Eventev)
Arguments
EventevNew message
Description

This will clone the given Event object and unlink any deletable userdata object from "ev".

 
 top of page
Method setAffinityMask32
Signature
setAffinityMask32(intmask)
Arguments
intmask

 
 top of page
Method setName
Signature
setName(Stringname)
Arguments
Stringname

 
 top of page
Method setPriority
Signature
setPriority(intprio)
Arguments
intprio

 
 top of page
Method setUserData
Signature
setUserData(Objecto)
Arguments
Objecto

 
 top of page
Method wait
Signature
wait():int
Returns
int

 
 top of page
Method waitEvent
Return next pending event or wait for new event to arrive.
Signature
waitEvent(inttimeout)
 :Event
Arguments
inttimeout0=wait forever, millisec. until timeout otherwise
Returns
EventEvent or null (timeout or interrupt)
Description

Please notice that this method returns null in case the wait() timed out or got interrupted.

 
 top of page
Method waitEventById
Return next pending event whose id matches "id" or wait for new matching event to arrive.
Signature
waitEventById(intid,
  inttimeout,
  int 
  )  
 :Event
Arguments
intid
inttimeout0=wait forever, millisec. until timeout otherwise
int
Returns
EventEvent or null (timeout or interrupt)
Description

Please notice that this method returns null in case the wait() timed out or got interrupted.

 
 top of page
Constant THREAD_PRIORITY_ABOVE_NORMAL (int)
Constant THREAD_PRIORITY_BELOW_NORMAL (int)
Constant THREAD_PRIORITY_HIGHEST (int)
Constant THREAD_PRIORITY_IDLE (int)
Constant THREAD_PRIORITY_LOWEST (int)
Constant THREAD_PRIORITY_NORMAL (int)
Constant THREAD_PRIORITY_TIME_CRITICAL (int)

 

Project Modules:core 
Project Classes:Boolean , Buffer , Byte , Class , ClassArray , Condition , Configuration , Double , DummyStream , Envelope , Event , Exception , File , Float , FloatArray , FloatArray128 , FloatArray16 , FloatArray32 , FloatArray64 , FloatArray8 , Function , HashTable , IntArray , IntArray128 , IntArray16 , IntArray32 , IntArray64 , IntArray8 , Integer , List , ListNode , Long , Mailbox , Mutex , Object , ObjectArray , PakFile , PointerArray , Pool , Script , SharedBuffer , Short , Stack , StdErrStream , StdInStream , StdOutStream , Stream , String , String128 , String16 , String32 , String64 , String8 , StringArray , StringIterator , Thread , Time , TKS , TreeNode , UnsignedByte , UnsignedInteger , UnsignedLong , UnsignedShort , Value , ValueArray , Variable 
Project Functions:ceil , exit , floor , GetCurrentThread , getenv , lcchar , mathAbsMaxf , mathAbsMinf , mathAbsMini , mathAbsMini , mathClampf , mathClampi , mathDistancePointPlane2d , mathLerpf , mathMaxf , mathMaxi , mathMinf , mathMini , mathPowerf , mathPoweri , mathSmoothStepf , mathWrapf , mathWrapi , milliSeconds , psystem , putenv , srand , system , ucchar 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54