open-call in FTTP loader singleton

To prevent deadlock, we took care to adopt open-call in our synchronized singleton constructor.

Basically, our long constructor (any long constructor) tend to make calls to other objects. Eventually, one of the calls that another programmer add may invoke a method that invoke a synchronized method. Now step back and count how many locks are involved.

Some may question this is over-cautious — the class doesn’t have any other static synchronized method. But Future?

Open-call is defensive design.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s