Changeset 881 in svn


Ignore:
Timestamp:
2012-04-01T11:27:38+02:00 (3 years ago)
Author:
Xuefer
Message:

use _unlocked suffix for function name instead of _dmz

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r876 r881  
    117117/* }}} */
    118118
    119 /* any function in *_dmz is only safe be called within locked(single thread) area */
    120 
    121 static void xc_php_add_dmz(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */
     119/* any function in *_unlocked is only safe be called within locked (single thread access) area */
     120
     121static void xc_php_add_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */
    122122{
    123123    xc_entry_data_php_t **head = &(cache->phps[php->hvalue]);
     
    127127}
    128128/* }}} */
    129 static xc_entry_data_php_t *xc_php_store_dmz(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
     129static xc_entry_data_php_t *xc_php_store_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
    130130{
    131131    xc_entry_data_php_t *stored_php;
     
    135135    stored_php = xc_processor_store_xc_entry_data_php_t(cache, php TSRMLS_CC);
    136136    if (stored_php) {
    137         xc_php_add_dmz(cache, stored_php);
     137        xc_php_add_unlocked(cache, stored_php);
    138138        return stored_php;
    139139    }
     
    144144}
    145145/* }}} */
    146 static xc_entry_data_php_t *xc_php_find_dmz(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
     146static xc_entry_data_php_t *xc_php_find_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
    147147{
    148148    xc_entry_data_php_t *p;
     
    156156}
    157157/* }}} */
    158 static void xc_php_free_dmz(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */
     158static void xc_php_free_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */
    159159{
    160160    cache->mem->handlers->free(cache->mem, (xc_entry_data_php_t *)php);
    161161}
    162162/* }}} */
    163 static void xc_php_addref_dmz(xc_entry_data_php_t *php) /* {{{ */
     163static void xc_php_addref_unlocked(xc_entry_data_php_t *php) /* {{{ */
    164164{
    165165    php->refcount ++;
    166166}
    167167/* }}} */
    168 static void xc_php_release_dmz(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */
     168static void xc_php_release_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */
    169169{
    170170    if (-- php->refcount == 0) {
     
    175175                /* unlink */
    176176                *pp = p->next;
    177                 xc_php_free_dmz(cache, php);
     177                xc_php_free_unlocked(cache, php);
    178178                return;
    179179            }
     
    184184/* }}} */
    185185
    186 static inline int xc_entry_equal_dmz(xc_entry_type_t type, const xc_entry_t *entry1, const xc_entry_t *entry2) /* {{{ */
     186static inline int xc_entry_equal_unlocked(xc_entry_type_t type, const xc_entry_t *entry1, const xc_entry_t *entry2) /* {{{ */
    187187{
    188188    /* this function isn't required but can be in dmz */
     
    234234}
    235235/* }}} */
    236 static inline int xc_entry_has_prefix_dmz(xc_entry_type_t type, xc_entry_t *entry, zval *prefix) /* {{{ */
     236static inline int xc_entry_has_prefix_unlocked(xc_entry_type_t type, xc_entry_t *entry, zval *prefix) /* {{{ */
    237237{
    238238    /* this function isn't required but can be in dmz */
     
    261261}
    262262/* }}} */
    263 static void xc_entry_add_dmz(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry) /* {{{ */
     263static void xc_entry_add_unlocked(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry) /* {{{ */
    264264{
    265265    xc_entry_t **head = &(cache->entries[entryslotid]);
     
    269269}
    270270/* }}} */
    271 static xc_entry_t *xc_entry_store_dmz(xc_entry_type_t type, xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry TSRMLS_DC) /* {{{ */
     271static xc_entry_t *xc_entry_store_unlocked(xc_entry_type_t type, xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry TSRMLS_DC) /* {{{ */
    272272{
    273273    xc_entry_t *stored_entry;
     
    280280        : (xc_entry_t *) xc_processor_store_xc_entry_var_t(cache, (xc_entry_var_t *) entry TSRMLS_CC);
    281281    if (stored_entry) {
    282         xc_entry_add_dmz(cache, entryslotid, stored_entry);
     282        xc_entry_add_unlocked(cache, entryslotid, stored_entry);
    283283        return stored_entry;
    284284    }
     
    289289}
    290290/* }}} */
    291 static xc_entry_php_t *xc_entry_php_store_dmz(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_php_t *entry_php TSRMLS_DC) /* {{{ */
    292 {
    293     return (xc_entry_php_t *) xc_entry_store_dmz(XC_TYPE_PHP, cache, entryslotid, (xc_entry_t *) entry_php TSRMLS_CC);
    294 }
    295 /* }}} */
    296 static xc_entry_var_t *xc_entry_var_store_dmz(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_var_t *entry_var TSRMLS_DC) /* {{{ */
    297 {
    298     return (xc_entry_var_t *) xc_entry_store_dmz(XC_TYPE_VAR, cache, entryslotid, (xc_entry_t *) entry_var TSRMLS_CC);
    299 }
    300 /* }}} */
    301 static void xc_entry_free_real_dmz(xc_entry_type_t type, xc_cache_t *cache, volatile xc_entry_t *entry) /* {{{ */
     291static xc_entry_php_t *xc_entry_php_store_unlocked(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_php_t *entry_php TSRMLS_DC) /* {{{ */
     292{
     293    return (xc_entry_php_t *) xc_entry_store_unlocked(XC_TYPE_PHP, cache, entryslotid, (xc_entry_t *) entry_php TSRMLS_CC);
     294}
     295/* }}} */
     296static xc_entry_var_t *xc_entry_var_store_unlocked(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_var_t *entry_var TSRMLS_DC) /* {{{ */
     297{
     298    return (xc_entry_var_t *) xc_entry_store_unlocked(XC_TYPE_VAR, cache, entryslotid, (xc_entry_t *) entry_var TSRMLS_CC);
     299}
     300/* }}} */
     301static void xc_entry_free_real_unlocked(xc_entry_type_t type, xc_cache_t *cache, volatile xc_entry_t *entry) /* {{{ */
    302302{
    303303    if (type == XC_TYPE_PHP) {
    304         xc_php_release_dmz(cache, ((xc_entry_php_t *) entry)->php);
     304        xc_php_release_unlocked(cache, ((xc_entry_php_t *) entry)->php);
    305305    }
    306306    cache->mem->handlers->free(cache->mem, (xc_entry_t *)entry);
    307307}
    308308/* }}} */
    309 static void xc_entry_free_dmz(xc_entry_type_t type, xc_cache_t *cache, xc_entry_t *entry TSRMLS_DC) /* {{{ */
     309static void xc_entry_free_unlocked(xc_entry_type_t type, xc_cache_t *cache, xc_entry_t *entry TSRMLS_DC) /* {{{ */
    310310{
    311311    cache->entries_count --;
    312312    if ((type == XC_TYPE_PHP ? ((xc_entry_php_t *) entry)->refcount : 0) == 0) {
    313         xc_entry_free_real_dmz(type, cache, entry);
     313        xc_entry_free_real_unlocked(type, cache, entry);
    314314    }
    315315    else {
     
    322322}
    323323/* }}} */
    324 static void xc_entry_remove_dmz(xc_entry_type_t type, xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry TSRMLS_DC) /* {{{ */
     324static void xc_entry_remove_unlocked(xc_entry_type_t type, xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry TSRMLS_DC) /* {{{ */
    325325{
    326326    xc_entry_t **pp = &(cache->entries[entryslotid]);
    327327    xc_entry_t *p;
    328328    for (p = *pp; p; pp = &(p->next), p = p->next) {
    329         if (xc_entry_equal_dmz(type, entry, p)) {
     329        if (xc_entry_equal_unlocked(type, entry, p)) {
    330330            /* unlink */
    331331            *pp = p->next;
    332             xc_entry_free_dmz(type, cache, entry TSRMLS_CC);
     332            xc_entry_free_unlocked(type, cache, entry TSRMLS_CC);
    333333            return;
    334334        }
     
    337337}
    338338/* }}} */
    339 static xc_entry_t *xc_entry_find_dmz(xc_entry_type_t type, xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry TSRMLS_DC) /* {{{ */
     339static xc_entry_t *xc_entry_find_unlocked(xc_entry_type_t type, xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry TSRMLS_DC) /* {{{ */
    340340{
    341341    xc_entry_t *p;
    342342    for (p = cache->entries[entryslotid]; p; p = p->next) {
    343         if (xc_entry_equal_dmz(type, entry, p)) {
     343        if (xc_entry_equal_unlocked(type, entry, p)) {
    344344            zend_bool fresh;
    345345            switch (type) {
     
    368368            }
    369369
    370             xc_entry_remove_dmz(type, cache, entryslotid, p TSRMLS_CC);
     370            xc_entry_remove_unlocked(type, cache, entryslotid, p TSRMLS_CC);
    371371            return NULL;
    372372        }
     
    375375}
    376376/* }}} */
    377 static void xc_entry_hold_php_dmz(xc_cache_t *cache, xc_entry_php_t *entry TSRMLS_DC) /* {{{ */
     377static void xc_entry_hold_php_unlocked(xc_cache_t *cache, xc_entry_php_t *entry TSRMLS_DC) /* {{{ */
    378378{
    379379    TRACE("hold %d:%s", entry->file_inode, entry->entry.name.str.val);
     
    413413}
    414414/* }}} */
    415 static void xc_cache_hit_dmz(xc_cache_t *cache TSRMLS_DC) /* {{{ */
     415static void xc_cache_hit_unlocked(xc_cache_t *cache TSRMLS_DC) /* {{{ */
    416416{
    417417    cache->hits ++;
     
    434434/* helper function that loop through each entry */
    435435#define XC_ENTRY_APPLY_FUNC(name) zend_bool name(xc_entry_t *entry TSRMLS_DC)
    436 typedef XC_ENTRY_APPLY_FUNC((*cache_apply_dmz_func_t));
    437 static void xc_entry_apply_dmz(xc_entry_type_t type, xc_cache_t *cache, cache_apply_dmz_func_t apply_func TSRMLS_DC) /* {{{ */
     436typedef XC_ENTRY_APPLY_FUNC((*cache_apply_unlocked_func_t));
     437static void xc_entry_apply_unlocked(xc_entry_type_t type, xc_cache_t *cache, cache_apply_dmz_func_t apply_func TSRMLS_DC) /* {{{ */
    438438{
    439439    xc_entry_t *p, **pp;
     
    446446                /* unlink */
    447447                *pp = p->next;
    448                 xc_entry_free_dmz(type, cache, p TSRMLS_CC);
     448                xc_entry_free_unlocked(type, cache, p TSRMLS_CC);
    449449            }
    450450            else {
     
    458458#define XC_CACHE_APPLY_FUNC(name) void name(xc_cache_t *cache TSRMLS_DC)
    459459/* call graph:
    460  * xc_gc_expires_php -> xc_gc_expires_one -> xc_entry_apply_dmz -> xc_gc_expires_php_entry_dmz
    461  * xc_gc_expires_var -> xc_gc_expires_one -> xc_entry_apply_dmz -> xc_gc_expires_var_entry_dmz
     460 * xc_gc_expires_php -> xc_gc_expires_one -> xc_entry_apply_unlocked -> xc_gc_expires_php_entry_dmz
     461 * xc_gc_expires_var -> xc_gc_expires_one -> xc_entry_apply_unlocked -> xc_gc_expires_var_entry_dmz
    462462 */
    463 static XC_ENTRY_APPLY_FUNC(xc_gc_expires_php_entry_dmz) /* {{{ */
     463static XC_ENTRY_APPLY_FUNC(xc_gc_expires_php_entry_unlocked) /* {{{ */
    464464{
    465465    TRACE("ttl %lu, %lu %lu", (zend_ulong) XG(request_time), (zend_ulong) entry->atime, xc_php_ttl);
     
    470470}
    471471/* }}} */
    472 static XC_ENTRY_APPLY_FUNC(xc_gc_expires_var_entry_dmz) /* {{{ */
     472static XC_ENTRY_APPLY_FUNC(xc_gc_expires_var_entry_unlocked) /* {{{ */
    473473{
    474474    if (VAR_ENTRY_EXPIRED(entry)) {
     
    478478}
    479479/* }}} */
    480 static void xc_gc_expires_one(xc_entry_type_t type, xc_cache_t *cache, zend_ulong gc_interval, cache_apply_dmz_func_t apply_func TSRMLS_DC) /* {{{ */
     480static void xc_gc_expires_one(xc_entry_type_t type, xc_cache_t *cache, zend_ulong gc_interval, cache_apply_unlocked_func_t apply_func TSRMLS_DC) /* {{{ */
    481481{
    482482    TRACE("interval %lu, %lu %lu", (zend_ulong) XG(request_time), (zend_ulong) cache->last_gc_expires, gc_interval);
     
    485485            if (XG(request_time) - cache->last_gc_expires >= gc_interval) {
    486486                cache->last_gc_expires = XG(request_time);
    487                 xc_entry_apply_dmz(type, cache, apply_func TSRMLS_CC);
     487                xc_entry_apply_unlocked(type, cache, apply_func TSRMLS_CC);
    488488            }
    489489        } LEAVE_LOCK(cache);
     
    500500
    501501    for (i = 0, c = xc_php_hcache.size; i < c; i ++) {
    502         xc_gc_expires_one(XC_TYPE_PHP, xc_php_caches[i], xc_php_gc_interval, xc_gc_expires_php_entry_dmz TSRMLS_CC);
     502        xc_gc_expires_one(XC_TYPE_PHP, xc_php_caches[i], xc_php_gc_interval, xc_gc_expires_php_entry_unlocked TSRMLS_CC);
    503503    }
    504504}
     
    513513
    514514    for (i = 0, c = xc_var_hcache.size; i < c; i ++) {
    515         xc_gc_expires_one(XC_TYPE_VAR, xc_var_caches[i], xc_var_gc_interval, xc_gc_expires_var_entry_dmz TSRMLS_CC);
    516     }
    517 }
    518 /* }}} */
    519 
    520 static XC_CACHE_APPLY_FUNC(xc_gc_delete_dmz) /* {{{ */
     515        xc_gc_expires_one(XC_TYPE_VAR, xc_var_caches[i], xc_var_gc_interval, xc_gc_expires_var_entry_unlocked TSRMLS_CC);
     516    }
     517}
     518/* }}} */
     519
     520static XC_CACHE_APPLY_FUNC(xc_gc_delete_unlocked) /* {{{ */
    521521{
    522522    xc_entry_t *p, **pp;
     
    533533            *pp = p->next;
    534534            cache->deletes_count --;
    535             xc_entry_free_real_dmz(XC_TYPE_PHP, cache, p);
     535            xc_entry_free_real_unlocked(XC_TYPE_PHP, cache, p);
    536536        }
    537537        else {
     
    547547            if (cache->deletes && XG(request_time) - cache->last_gc_deletes > xc_deletes_gc_interval) {
    548548                cache->last_gc_deletes = XG(request_time);
    549                 xc_gc_delete_dmz(cache TSRMLS_CC);
     549                xc_gc_delete_unlocked(cache TSRMLS_CC);
    550550            }
    551551        } LEAVE_LOCK(cache);
     
    572572
    573573/* helper functions for user functions */
    574 static void xc_fillinfo_dmz(int cachetype, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */
     574static void xc_fillinfo_unlocked(int cachetype, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */
    575575{
    576576    zval *blocks, *hits;
     
    647647}
    648648/* }}} */
    649 static void xc_fillentry_dmz(xc_entry_type_t type, const xc_entry_t *entry, xc_hash_value_t entryslotid, int del, zval *list TSRMLS_DC) /* {{{ */
     649static void xc_fillentry_unlocked(xc_entry_type_t type, const xc_entry_t *entry, xc_hash_value_t entryslotid, int del, zval *list TSRMLS_DC) /* {{{ */
    650650{
    651651    zval* ei;
     
    717717}
    718718/* }}} */
    719 static void xc_filllist_dmz(xc_entry_type_t type, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */
     719static void xc_filllist_unlocked(xc_entry_type_t type, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */
    720720{
    721721    zval* list;
     
    728728    for (i = 0, c = cache->hentry->size; i < c; i ++) {
    729729        for (e = cache->entries[i]; e; e = e->next) {
    730             xc_fillentry_dmz(type, e, i, 0, list TSRMLS_CC);
     730            xc_fillentry_unlocked(type, e, i, 0, list TSRMLS_CC);
    731731        }
    732732    }
     
    736736    array_init(list);
    737737    for (e = cache->deletes; e; e = e->next) {
    738         xc_fillentry_dmz(XC_TYPE_PHP, e, 0, 1, list TSRMLS_CC);
     738        xc_fillentry_unlocked(XC_TYPE_PHP, e, 0, 1, list TSRMLS_CC);
    739739    }
    740740    add_assoc_zval(return_value, "deleted_list", list);
     
    990990} xc_entry_find_include_path_data_t;
    991991/* }}} */
    992 static XC_INCLUDE_PATH_XSTAT_FUNC(xc_entry_find_include_path_func_dmz) /* {{{ */
     992static XC_INCLUDE_PATH_XSTAT_FUNC(xc_entry_find_include_path_func_unlocked) /* {{{ */
    993993{
    994994    xc_entry_find_include_path_data_t *entry_find_include_path_data = (xc_entry_find_include_path_data_t *) data;
     
    998998    compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val);
    999999
    1000     *entry_find_include_path_data->stored_entry = (xc_entry_php_t *) xc_entry_find_dmz(
     1000    *entry_find_include_path_data->stored_entry = (xc_entry_php_t *) xc_entry_find_unlocked(
    10011001            XC_TYPE_PHP
    10021002            , xc_php_caches[compiler->entry_hash.cacheid]
     
    10081008}
    10091009/* }}} */
    1010 static int xc_entry_find_include_path_dmz(xc_compiler_t *compiler, const char *filepath, xc_entry_php_t **stored_entry TSRMLS_DC) /* {{{ */
     1010static int xc_entry_find_include_path_unlocked(xc_compiler_t *compiler, const char *filepath, xc_entry_php_t **stored_entry TSRMLS_DC) /* {{{ */
    10111011{
    10121012    char path_buffer[MAXPATHLEN];
     
    10151015    entry_find_include_path_data.stored_entry = stored_entry;
    10161016
    1017     return xc_include_path_apply(filepath, path_buffer, xc_entry_find_include_path_func_dmz, (void *) &entry_find_include_path_data TSRMLS_DC)
     1017    return xc_include_path_apply(filepath, path_buffer, xc_entry_find_include_path_func_unlocked, (void *) &entry_find_include_path_data TSRMLS_DC)
    10181018        ? SUCCESS
    10191019        : FAILURE;
     
    19031903
    19041904    ENTER_LOCK_EX(cache) {
    1905         if (!compiler->opened_path && xc_entry_find_include_path_dmz(compiler, compiler->filename, &stored_entry TSRMLS_CC) == SUCCESS) {
     1905        if (!compiler->opened_path && xc_entry_find_include_path_unlocked(compiler, compiler->filename, &stored_entry TSRMLS_CC) == SUCCESS) {
    19061906            compiler->opened_path = compiler->new_entry.entry.name.str.val;
    19071907        }
     
    19161916            compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val);
    19171917
    1918             stored_entry = (xc_entry_php_t *) xc_entry_find_dmz(XC_TYPE_PHP, cache, compiler->entry_hash.entryslotid, (xc_entry_t *) &compiler->new_entry TSRMLS_CC);
     1918            stored_entry = (xc_entry_php_t *) xc_entry_find_unlocked(XC_TYPE_PHP, cache, compiler->entry_hash.entryslotid, (xc_entry_t *) &compiler->new_entry TSRMLS_CC);
    19191919        }
    19201920
    19211921        if (stored_entry) {
    1922             xc_cache_hit_dmz(cache TSRMLS_CC);
     1922            xc_cache_hit_unlocked(cache TSRMLS_CC);
    19231923
    19241924            TRACE(" hit %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val);
    1925             xc_entry_hold_php_dmz(cache, stored_entry TSRMLS_CC);
     1925            xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC);
    19261926            stored_php = stored_entry->php;
    19271927            break;
     
    19361936        }
    19371937
    1938         stored_php = xc_php_find_dmz(cache, &compiler->new_php TSRMLS_CC);
     1938        stored_php = xc_php_find_unlocked(cache, &compiler->new_php TSRMLS_CC);
    19391939
    19401940        if (stored_php) {
    19411941            compiler->new_entry.php = stored_php;
    1942             xc_php_addref_dmz(stored_php);
     1942            xc_php_addref_unlocked(stored_php);
    19431943            xc_entry_php_init(&compiler->new_entry, compiler->opened_path TSRMLS_CC);
    1944             stored_entry = xc_entry_php_store_dmz(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC);
     1944            stored_entry = xc_entry_php_store_unlocked(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC);
    19451945            TRACE(" cached %d:%s, holding", compiler->new_entry.file_inode, stored_entry->entry.name.str.val);
    1946             xc_entry_hold_php_dmz(cache, stored_entry TSRMLS_CC);
     1946            xc_entry_hold_php_unlocked(cache, stored_entry TSRMLS_CC);
    19471947            break;
    19481948        }
     
    20152015    ENTER_LOCK_EX(cache) { /* {{{ php_store/entry_store */
    20162016        /* php_store */
    2017         stored_php = xc_php_store_dmz(cache, &compiler->new_php TSRMLS_CC);
     2017        stored_php = xc_php_store_unlocked(cache, &compiler->new_php TSRMLS_CC);
    20182018        if (!stored_php) {
    20192019            /* error */
     
    20222022        /* entry_store */
    20232023        compiler->new_entry.php = stored_php;
    2024         xc_php_addref_dmz(stored_php);
    2025         stored_entry = xc_entry_php_store_dmz(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC);
     2024        xc_php_addref_unlocked(stored_php);
     2025        stored_entry = xc_entry_php_store_unlocked(cache, compiler->entry_hash.entryslotid, &compiler->new_entry TSRMLS_CC);
    20262026        if (!stored_entry) {
    2027             xc_php_release_dmz(cache, stored_php);
     2027            xc_php_release_unlocked(cache, stored_php);
    20282028        }
    20292029    } LEAVE_LOCK_EX(cache);
     
    26722672            ENTER_LOCK(cache) {
    26732673                if (optype == XC_OP_INFO) {
    2674                     xc_fillinfo_dmz(type, cache, return_value TSRMLS_CC);
     2674                    xc_fillinfo_unlocked(type, cache, return_value TSRMLS_CC);
    26752675                }
    26762676                else {
    2677                     xc_filllist_dmz(type, cache, return_value TSRMLS_CC);
     2677                    xc_filllist_unlocked(type, cache, return_value TSRMLS_CC);
    26782678                }
    26792679            } LEAVE_LOCK(cache);
     
    26942694                        for (e = cache->entries[entryslotid]; e; e = next) {
    26952695                            next = e->next;
    2696                             xc_entry_remove_dmz(type, cache, entryslotid, e TSRMLS_CC);
     2696                            xc_entry_remove_unlocked(type, cache, entryslotid, e TSRMLS_CC);
    26972697                        }
    26982698                        cache->entries[entryslotid] = NULL;
     
    27922792
    27932793    ENTER_LOCK(cache) {
    2794         stored_entry_var = (xc_entry_var_t *) xc_entry_find_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
     2794        stored_entry_var = (xc_entry_var_t *) xc_entry_find_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
    27952795        if (stored_entry_var) {
    27962796            /* return */
    27972797            xc_processor_restore_zval(return_value, stored_entry_var->value, stored_entry_var->have_references TSRMLS_CC);
    2798             xc_cache_hit_dmz(cache TSRMLS_CC);
     2798            xc_cache_hit_unlocked(cache TSRMLS_CC);
    27992799        }
    28002800        else {
     
    28342834
    28352835    ENTER_LOCK(cache) {
    2836         stored_entry_var = (xc_entry_var_t *) xc_entry_find_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
     2836        stored_entry_var = (xc_entry_var_t *) xc_entry_find_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
    28372837        if (stored_entry_var) {
    2838             xc_entry_remove_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_entry_var TSRMLS_CC);
     2838            xc_entry_remove_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_entry_var TSRMLS_CC);
    28392839        }
    28402840        entry_var.value = value;
    2841         RETVAL_BOOL(xc_entry_var_store_dmz(cache, entry_hash.entryslotid, &entry_var TSRMLS_CC) != NULL ? 1 : 0);
     2841        RETVAL_BOOL(xc_entry_var_store_unlocked(cache, entry_hash.entryslotid, &entry_var TSRMLS_CC) != NULL ? 1 : 0);
    28422842    } LEAVE_LOCK(cache);
    28432843}
     
    28642864
    28652865    ENTER_LOCK(cache) {
    2866         stored_entry_var = (xc_entry_var_t *) xc_entry_find_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
     2866        stored_entry_var = (xc_entry_var_t *) xc_entry_find_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
    28672867        if (stored_entry_var) {
    2868             xc_cache_hit_dmz(cache TSRMLS_CC);
     2868            xc_cache_hit_unlocked(cache TSRMLS_CC);
    28692869            RETVAL_TRUE;
    28702870            /* return */
     
    28982898
    28992899    ENTER_LOCK(cache) {
    2900         stored_entry_var = (xc_entry_var_t *) xc_entry_find_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
     2900        stored_entry_var = (xc_entry_var_t *) xc_entry_find_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
    29012901        if (stored_entry_var) {
    2902             xc_entry_remove_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_entry_var TSRMLS_CC);
     2902            xc_entry_remove_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_entry_var TSRMLS_CC);
    29032903            RETVAL_TRUE;
    29042904        }
     
    29332933                for (entry = cache->entries[entryslotid]; entry; entry = next) {
    29342934                    next = entry->next;
    2935                     if (xc_entry_has_prefix_dmz(XC_TYPE_VAR, entry, prefix)) {
    2936                         xc_entry_remove_dmz(XC_TYPE_VAR, cache, entryslotid, entry TSRMLS_CC);
     2935                    if (xc_entry_has_prefix_unlocked(XC_TYPE_VAR, entry, prefix)) {
     2936                        xc_entry_remove_unlocked(XC_TYPE_VAR, cache, entryslotid, entry TSRMLS_CC);
    29372937                    }
    29382938                }
     
    29712971
    29722972    ENTER_LOCK(cache) {
    2973         stored_entry_var = (xc_entry_var_t *) xc_entry_find_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
     2973        stored_entry_var = (xc_entry_var_t *) xc_entry_find_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) &entry_var TSRMLS_CC);
    29742974        if (stored_entry_var) {
    29752975            TRACE("incdec: got entry_var %s", entry_var.entry.name.str.val);
     
    30073007            entry_var.entry.ctime = stored_entry_var->entry.ctime;
    30083008            entry_var.entry.hits  = stored_entry_var->entry.hits;
    3009             xc_entry_remove_dmz(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_entry_var TSRMLS_CC);
    3010         }
    3011         xc_entry_var_store_dmz(cache, entry_hash.entryslotid, &entry_var TSRMLS_CC);
     3009            xc_entry_remove_unlocked(XC_TYPE_VAR, cache, entry_hash.entryslotid, (xc_entry_t *) stored_entry_var TSRMLS_CC);
     3010        }
     3011        xc_entry_var_store_unlocked(cache, entry_hash.entryslotid, &entry_var TSRMLS_CC);
    30123012    } LEAVE_LOCK(cache);
    30133013}
Note: See TracChangeset for help on using the changeset viewer.