Search code examples
javaconcurrencysynchronizationapache-commons

SynchronizedSet in apache commons


Why is there Apache's Synchronized Set when we have Collection's SynchronizedSet?

Is it better in any way?


Solution

  • My guess is because it allows you to specify a custom lock object.

    The constructor is protected but you can subclass it and pass a custom lock.