HELP! * GREY=local LOCAL HTML version of Foils prepared July 10 1996

Foil 115 Threads and Synchronization - wait()

From Basic Lectures on Java Language Applets Graphics Networking Trip to China and Icase Tutorial -- July 12-28 and June 10-13 96. by Geoffrey C. Fox * See also color IMAGE

void wait()
void wait(int timeout)
  • The wait() method is part of the Object class, and hence available for every object.
  • This method simply causes the thread to wait until notified or until the timeout occurs.
  • timeout is an optional argument. If missing or zero, thread waits until notify/notifyall called
  • This method must be called from a synchronized method.
  • wait() will be called while thread owns lock associated with a particular object. wait() releases this lock (atomically i.e. safely)



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Feb 18 1997