'Acquire a cache lock for this tile.
Returns nothing, but blocks until the lock has been acquired.'

def lock(self, layer, coord, format):

    key_name = tile_key(layer, coord, format)
    due = (time() + layer.stale_lock_timeout)
    while (time() < due):
        if (not self.bucket.get_key((key_name + '-lock'))):
            break
        _sleep(0.2)
    key = self.bucket.new_key((key_name + '-lock'))
    key.set_contents_from_string('locked.', {'Content-Type': 'text/plain'})
