Make Object refcounting functions atomic