'Check whether the registry has changed, and performs all necessary
operations to update the registry. Return an up-to-date registry.'

def check_signaling(self):

    if (not odoo.multi_process):
        return self
    with closing(self.cursor()) as cr:
        cr.execute('    SELECT    base_registry_signaling.last_value,\n                                                                                                                                        base_cache_signaling.last_value\n                                                                                                            FROM    base_registry_signaling,    base_cache_signaling')
        (r, c) = cr.fetchone()
        _logger.debug('Multiprocess    signaling    check:    [Registry    -    %s    ->    %s]    [Cache    -    %s    ->    %s]', self.registry_sequence, r, self.cache_sequence, c)
        if (self.registry_sequence != r):
            _logger.info('Reloading    the    model    registry    after    database    signaling.')
            self = Registry.new(self.db_name)
        elif (self.cache_sequence != c):
            _logger.info('Invalidating    all    model    caches    after    database    signaling.')
            self.clear_caches()
            self.cache_cleared = False
        self.registry_sequence = r
        self.cache_sequence = c
    return self
