I want to synchronize a block of code, but do not want to simply lock on the implementing class (this).
The block of code in question is part of a method which takes in an id.
I want to disallow a new thread from entering the block if the id passed into the method is contained within a list in the class... if it not in the list, the entity is free to operate on, and thus the thread will be allowed into the block...
Is there a straight forward way to do this?