Changeset c67d47e in git for mod_cacher/xc_cacher.c


Ignore:
Timestamp:
2012-12-17T17:11:58Z (7 years ago)
Author:
Xuefer <xuefer@…>
Branches:
3.0, 3.1, 3.2, master, trunk
Children:
ddbd8a1
Parents:
8d9274c
Message:

finished improve stability on threaded env

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1204 c26eb9a1-5813-0410-bd6c-c2e55f420ca7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mod_cacher/xc_cacher.c

    r36ef103 rc67d47e  
    4141
    4242#define ENTER_LOCK_EX(x) \
    43     xc_lock((x)->lck); \
     43    LOCK((x)); \
    4444    zend_try { \
    4545        do
     
    4949        catched = 1; \
    5050    } zend_end_try(); \
    51     xc_unlock((x)->lck)
     51    UNLOCK((x))
    5252
    5353#define ENTER_LOCK(x) do { \
     
    26512651        }
    26522652        CHECK(allocator->vtable->init(shm, allocator, memsize), "Failed init allocator");
    2653         CHECK(cache->cached           = allocator->vtable->calloc(allocator, 1, sizeof(xc_cached_t)), "cache OOM");
    2654         CHECK(cache->cached->entries  = allocator->vtable->calloc(allocator, hentry->size, sizeof(xc_entry_t*)), "entries OOM");
     2653        CHECK(cache->cached           = allocator->vtable->calloc(allocator, 1, sizeof(xc_cached_t)), "create cache OOM");
     2654        CHECK(cache->cached->entries  = allocator->vtable->calloc(allocator, hentry->size, sizeof(xc_entry_t*)), "create entries OOM");
    26552655        if (hphp) {
    2656             CHECK(cache->cached->phps = allocator->vtable->calloc(allocator, hphp->size, sizeof(xc_entry_data_php_t*)), "phps OOM");
    2657         }
    2658         CHECK(cache->lck              = xc_lock_init(NULL, 0), "can't create lock");
     2656            CHECK(cache->cached->phps = allocator->vtable->calloc(allocator, hphp->size, sizeof(xc_entry_data_php_t*)), "create phps OOM");
     2657        }
     2658        CHECK(cache->lck              = allocator->vtable->calloc(allocator, 1, xc_lock_size()), "create lock OOM");
     2659        CHECK(xc_lock_init(cache->lck, NULL, 1), "can't create lock");
    26592660
    26602661        cache->hcache  = hcache;
Note: See TracChangeset for help on using the changeset viewer.