Designing Thread Safe ClassesCombine ownership, invariants, synchronization and safe publication to design a complete thread-safe class.