public void unregister(PeerControlInstance instance) { try { this_mon.enter(); Map<PeerControlInstance, instanceWrapper> new_map = new HashMap<PeerControlInstance, instanceWrapper>(instance_map); instanceWrapper wrapper = new_map.remove(instance); if (wrapper == null) { Debug.out("instance wrapper not found"); return; } wrapper.unregister(); instance_map = new_map; registrations_changed = true; } finally { this_mon.exit(); } }