On 8/26/22 10:13, mw wrote:
> Object lock = (a particular condition) ? realLock : null;And I want to point out that "a particular condition" must not change between the check above and the following synchronized statement.
> > synchronized(lock) { > // lots of complex code block here > } Ali