JNodeOS v1.1.5 API

edu.utah.janos.nodeos
Class Thread

java.lang.Object
  |
  +--edu.utah.janos.nodeos.Thread

public class Thread
extends java.lang.Object

A Janos Thread. java.lang.Thread is not visible to threads running on the NodeOS.

There are no visible Thread objects in Janos (all the methods here are static ones). New threads are created either implicitly in response to packets, or explicitly by a call to Flow.threadStart(...).

Author:
Janos Ministry of Development
See Also:
Flow.threadStart(java.lang.Runnable,String)

Method Summary
static java.lang.Object getObject()
          Get the per-thread object pointer.
static java.lang.Object setObject(java.lang.Object obj)
          Set the per-thread object pointer.
static void sleep(long millis, int nanos)
          Put the current thread to sleep for at least the given amount of time.
static void yield()
          An undirected yield.
static void yieldTo(Thread yieldTo)
          The mighty directed yield.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

yieldTo

public static void yieldTo(Thread yieldTo)
The mighty directed yield.

The scheduler may honor the argument. Or it may laugh at your suggestion and put the target thread in a black hole just to spite you.

Operates on the current thread, implicitly.

Parameters:
yieldTo - the thread that should be run in deference to the current thread.

yield

public static void yield()
An undirected yield.

Equivalent to yield(null).


sleep

public static void sleep(long millis,
                         int nanos)
                  throws java.lang.InterruptedException
Put the current thread to sleep for at least the given amount of time.

Operates on the current thread, implicitly.


setObject

public static java.lang.Object setObject(java.lang.Object obj)
Set the per-thread object pointer. Operates on the current thread, implicitly.

Returns the old object.


getObject

public static java.lang.Object getObject()
Get the per-thread object pointer. Operates on the current thread, implicitly.

JNodeOS v1.1.5 API

This documentation is Copyright (C) 1998-2001 The University of Utah. All Rights Reserved. See the file LICENSE for distribution terms.
Documentation, software, and mailing list archives for Janos can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/