Bugfix: properly lock access to synchronized set.

Also: document how this is done.

Also: remove useless interrupted check.