Good practices to use synchronized blocks