As you say, the βreleaseβ process is completely different - if it is based on notify() , the other is based on the completion of the stream. These are completely different appeals that serve completely different purposes.
Actually, there are explicit warnings not to call wait() on Thread monitors (although I cannot immediately find these warnings), since the internal Java code acquires locks for them (and uses wait / notify ).
But no, calling join() on Thread does not free the monitor if it owns the current executable thread.
Basically, you should not think of them as similar at all - one of them is waiting for the stream to complete; the other is to wait for coordination of cooperation.
source share