def METHOD_NAME(self, stepid, name, url, _racehook=None):
    # This methods adds an URL to the db
    # This is a read modify write and thus there is a possibility
    # that several urls are added at the same time (e.g with a deferredlist
    # at the end of a step)
    # this race condition is only inside the same master, as only one master
    # is supposed to add urls to a buildstep.
    # so threading.lock is used, as we are in the thread pool
    if self.url_lock is None:
        # this runs in reactor thread, so no race here..
        self.url_lock = defer.DeferredLock()
    def thd(conn):
        tbl = self.db.model.steps
        wc = tbl.c.id == stepid
        q = sa.select([tbl.c.urls_json],
                      whereclause=wc)
        res = conn.execute(q)
        row = res.fetchone()
        if _racehook is not None:
            _racehook()
        urls = json.loads(row.urls_json)
        url_item = {"name": name, "url": url}
        if url_item not in urls:
            urls.append(url_item)
            q = tbl.update(whereclause=wc)
            conn.execute(q, urls_json=json.dumps(urls))
    return self.url_lock.run(lambda: self.db.pool.do(thd))