Beispiel #1
0
hash_item *touch_item(struct default_engine *engine,
                           const void *key,
                           uint16_t nkey,
                           uint32_t exptime)
{
    hash_item *ret;

    pthread_mutex_lock(&engine->cache_lock);
    ret = do_touch_item(engine, key, nkey, exptime);
    pthread_mutex_unlock(&engine->cache_lock);
    return ret;
}
Beispiel #2
0
hash_item *touch_item(struct default_engine *engine,
                      const void* cookie,
                      const void* key,
                      uint16_t nkey,
                      uint32_t exptime)
{
    hash_item *ret;
    hash_key hkey;
    if (!hash_key_create(&hkey, key, nkey, engine, cookie)) {
        return NULL;
    }
    cb_mutex_enter(&engine->items.lock);
    ret = do_touch_item(engine, &hkey, exptime);
    cb_mutex_exit(&engine->items.lock);
    hash_key_destroy(&hkey);
    return ret;
}