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();
}
}
This documentation is Copyright (C) 2000-2002 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 Mar 17, 2002