Added thread-safety  comments in JavaDoc.