<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def stop_notifications(self):
 """Stop the notifications thread. :returns: """

        with self._notifications_lock:
            if not self.has_active_notification_thread:
                return
            thread = self._notifications_thread
            self._notifications_thread = None
            stopping = thread.stop()
            api = self._get_api(mds.NotificationsApi)
            api.delete_long_poll_channel()
            return stopping.wait()