Add example for atomics and object lifetime.