Ignore:
Timestamp:
2012-12-17T18:11:58+01:00 (21 months ago)
Author:
moo
Message:

finished improve stability on threaded env

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1201 r1204  
    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.