def cleanup(self):
        """
        End of life cycle management by remove itself from registry and unlink
        it self from parent if exists.
        """
        self.registry.remove_worker(self)
        if not self.is_background:
            assert self.parent.child_thread is self
            self.parent.child_thread = None

        End of life cycle management by remove itself from registry and unlink
        it self from parent if exists.
        
system/shthreads.py