Synchronized access to class and instance atttributes across threads, including lazy initialization of attributes