Skip to content

Replace synchronisation on this with use of an internal monitor object #6261

@wilkinsona

Description

@wilkinsona

Generally speaking synchronizing on this, either explicitly or by making a method synchronized, is a bad idea as it makes the lock part of the class's public API when it should almost always be an implementation detail. Among other things, exposing the lock increases the risk of deadlock.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions