edu.utah.janosvm.sys
Class TeamReservation
java.lang.Object
|
+--edu.utah.janosvm.sys.TeamReservation
- public class TeamReservation
- extends java.lang.Object
Record a reservation with another team. A TeamReservation is a link between
two teams that prevents either from being terminated. A TeamReservation is
more flexible than TeamHandle.switchTo, as the termination-delaying time can
be expanded to include more than the context switch to the other team.
Here's an example:
NOTE: TeamReservation objects are a bit odd since they are
never explicitly created. They are only implicitly created by the JanosVM
due to a call to team.pushReservation()
.
{
TeamReservation act;
...
act = otherTeam.pushReservation();
if (act != null)
{
Object obj;
act.visit();
// Do things in the context of 'otherTeam'
obj = lookupSimpleFoo();
act.leave();
// Do things in original context, but guarantee that
// otherTeam will not go away ... Reservation still active.
Object localObj = new Foo(obj);
// End the Reservation, as we're done with all pointers into otherTeam
Team.popReservation();
}
}
- Author:
- Tim Stack, Utah Janos Team
- See Also:
TeamHandle.pushReservation()
,
TeamHandle.popReservation()
,
TeamHandle.switchTo()
Method Summary |
static void |
leave()
Return to the previous team. |
static void |
pop()
Pop the last TeamReservation off the stack. |
void |
visit()
Switch the current thread to the team encoded in this Reservation. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
visit
public void visit()
throws TeamEjectionException
- Switch the current thread to the team encoded in this Reservation.
leave
public static void leave()
- Return to the previous team.
pop
public static void pop()
- Pop the last TeamReservation off the stack.
This documentation is Copyright (C) 2000-2001 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Jun 1, 2001