ReentrantLock - correct use or not?

Objects like ReentrantLocks are passed by reference. I’m not certain how primitives are handled.

But this also means, for example, you set a passend in variable to null within the lambda, it will only be set to null inside the lambda, not in the calling code.

I’d recommend Design Pattern: Gate Keeper over lambdas for this.

It centralizes the checking and sleeps/delays and eliminated any issues from using lambdas. I think it will result in simpler code in the end.