void Unlock(int id)
{
if (!locks.Remove(id))
{
throw new System.ArgumentException("This lock has already been released");
}
// Check if there are no remaining active locks
if (locks.Count == 0)
{
if (OnQueueUnblocked != null)
{
OnQueueUnblocked();
}
queue.Unblock();
}
}