Make constructors blocking

From CSSEMediaWiki
Jump to: navigation, search

Never when avoidable create threads or use unblocking methods inside a constructor. Having a constructor spawn a thread or group of threads to preform initialisation can result in the object being used before it is fully constructed. All operations to initialise the object should be checked to be complete before the constructor returns.

Personal tools