I just found this question because I asked myself the same thing. According to this article by Oracle researcher David Dice , the answer seems no . Here is the relevant part of the article:
If the stream is blocked in park() , we guarantee that subsequent unpark() will make it ready. A completely legal, but poor-quality implementation of park() and unpark() will be an empty method in which the program degenerates into a simple spinning. In fact, the litmus test for the correct use of park() is unpark() .
The empty park() and unpark() methods do not give you any action - before the relations guarantee, so for your program, which will be 100% portable, you should not rely on them.
Then again, Javadoc LockSupport says:
These methods are intended to be used as tools for creating higher-level synchronization utilities and are not in themselves useful for most concurrency management applications. The park method is intended for use only in constructions of the form:
while (!canProceed()) { ... LockSupport.park(this); }
Since you must explicitly check for a condition in any case that will either include volatile or correctly synchronized variables, then weak park() guarantees should not be a problem, right?
rolve
source share