'Define and analyze a function at the address ad.
TODO: check if nothing is erased before.
returns True if ok'

def set_function(self, ad):

    if (self.mem.is_func(ad) or (self.mem.get_func_id(ad) != (-1)) or self.mem.is_overlapping(ad)):
        return False
    self.__analyzer.msg.put((ad, True, True, False, self.__queue_wait))
    self.__queue_wait.get()
    return True
