...
When used securely, the signal()
method has better performance than signalAll()
.
When notify()
or signal()
is used to waken a waiting thread, and the thread is not prepared to resume execution, it often resumes waiting. Consequently, no thread wakens, which may cause the system to hang.
Noncompliant Code Example (notify()
)
...