Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

Class cornell.slk.jkernel.core.RunAsThreadSegment

Source code
java.lang.Object
    |
    +----cornell.slk.jkernel.core.RunAsThreadSegment

public final class RunAsThreadSegment
extends java.lang.Object
RunAsThreadSegment is a class for use by native code and system classes.

Native code and system classes sometimes create system Threads, rather than ThreadSegments. These system threads will not work properly in a cross-task invocation, or in many of the calls in the J-Kernel API. In order to use any J-Kernel functionality from one of these system threads, the system thread must call runAsThreadSegment, passing in a Runnable target object. runAsThreadSegment will run the target object's run method as a thread segment, and the target object code can make use of any J-Kernel features.

The RunAsThreadSegment object itself cannot be allocated from a system thread; it must be allocated by a thread segment.

Note that this is only relevant for native code and system classes, because the real Thread class is hidden from classes loaded into tasks with resolvers. These classes actually see a different Thread class, which is built on top of ThreadSegment.


Field Summary
Task  task
 
 

Constructor Summary
 RunAsThreadSegment()
 
 

Method Summary
void  runAsThreadSegment(java.lang.Runnable target)
 
 
Methods inherited from class java.lang.Object
 , clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

task

Task task
Constructor Detail

RunAsThreadSegment

public RunAsThreadSegment()
Method Detail

runAsThreadSegment

public void runAsThreadSegment(java.lang.Runnable target)

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS