Provides nonreenterant locking capability for a given ID. This class behaves similar to having an array of locks and
locking/unlocking array elements but is light-weight.
WARNING: These locks are not reenterant. If a thread locks the same ID multiple times it will wait forever.
Locks the given ID, waiting indefinitely if another thread already has a lock.
boolean tryLock(int lockID)
Tries to lock the given ID if it is possible to do so immediately and return true. If the lock is
already held by another thread, this function immediately returns false. Since this class does not
provide reentarant behavior, this function will return false even if it is the same thread that
holds the lock before this function call.