Thread methods of Object Flashcards Preview

OCP > Thread methods of Object > Flashcards

Flashcards in Thread methods of Object Deck (3)
Loading flashcards...
1
Q

Causes the thread to wait indefinitly or until the timeout period specified for a thread to call notify() when calling this method. The thread must have the lock of the object specified by this method.

A

void wait()

2
Q

The JVM chooses a single thread that is waiting for the lock and wakes it up. The thread calling this method must have the lock for the object referenced by this method.

A

void notify()

3
Q

The JVM wakes up all threads waiting on the lock. The thread calling this method must have the lock for the object referenced by this method.

A

void notifyAll()