Changeset 881
- Timestamp:
- 04/01/2012 11:27:38 AM (14 months ago)
- Files:
-
- 1 modified
-
trunk/xcache.c (modified) (50 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache.c
r876 r881 117 117 /* }}} */ 118 118 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 121 static void xc_php_add_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */ 122 122 { 123 123 xc_entry_data_php_t **head = &(cache->phps[php->hvalue]); … … 127 127 } 128 128 /* }}} */ 129 static xc_entry_data_php_t *xc_php_store_ dmz(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */129 static xc_entry_data_php_t *xc_php_store_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */ 130 130 { 131 131 xc_entry_data_php_t *stored_php; … … 135 135 stored_php = xc_processor_store_xc_entry_data_php_t(cache, php TSRMLS_CC); 136 136 if (stored_php) { 137 xc_php_add_ dmz(cache, stored_php);137 xc_php_add_unlocked(cache, stored_php); 138 138 return stored_php; 139 139 } … … 144 144 } 145 145 /* }}} */ 146 static xc_entry_data_php_t *xc_php_find_ dmz(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */146 static xc_entry_data_php_t *xc_php_find_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */ 147 147 { 148 148 xc_entry_data_php_t *p; … … 156 156 } 157 157 /* }}} */ 158 static void xc_php_free_ dmz(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */158 static void xc_php_free_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */ 159 159 { 160 160 cache->mem->handlers->free(cache->mem, (xc_entry_data_php_t *)php); 161 161 } 162 162 /* }}} */ 163 static void xc_php_addref_ dmz(xc_entry_data_php_t *php) /* {{{ */163 static void xc_php_addref_unlocked(xc_entry_data_php_t *php) /* {{{ */ 164 164 { 165 165 php->refcount ++; 166 166 } 167 167 /* }}} */ 168 static void xc_php_release_ dmz(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */168 static void xc_php_release_unlocked(xc_cache_t *cache, xc_entry_data_php_t *php) /* {{{ */ 169 169 { 170 170 if (-- php->refcount == 0) { … … 175 175 /* unlink */ 176 176 *pp = p->next; 177 xc_php_free_ dmz(cache, php);177 xc_php_free_unlocked(cache, php); 178 178 return; 179 179 } … … 184 184 /* }}} */ 185 185 186 static inline int xc_entry_equal_ dmz(xc_entry_type_t type, const xc_entry_t *entry1, const xc_entry_t *entry2) /* {{{ */186 static inline int xc_entry_equal_unlocked(xc_entry_type_t type, const xc_entry_t *entry1, const xc_entry_t *entry2) /* {{{ */ 187 187 { 188 188 /* this function isn't required but can be in dmz */ … … 234 234 } 235 235 /* }}} */ 236 static inline int xc_entry_has_prefix_ dmz(xc_entry_type_t type, xc_entry_t *entry, zval *prefix) /* {{{ */236 static inline int xc_entry_has_prefix_unlocked(xc_entry_type_t type, xc_entry_t *entry, zval *prefix) /* {{{ */ 237 237 { 238 238 /* this function isn't required but can be in dmz */ … … 261 261 } 262 262 /* }}} */ 263 static void xc_entry_add_ dmz(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry) /* {{{ */263 static void xc_entry_add_unlocked(xc_cache_t *cache, xc_hash_value_t entryslotid, xc_entry_t *entry) /* {{{ */ 264 264 { 265 265 xc_entry_t **head = &(cache->entries[entryslotid]); … … 269 269 } 270 270 /* }}} */ 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) /* {{{ */271 static 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) /* {{{ */ 272 272 { 273 273 xc_entry_t *stored_entry; … … 280 280 : (xc_entry_t *) xc_processor_store_xc_entry_var_t(cache, (xc_entry_var_t *) entry TSRMLS_CC); 281 281 if (stored_entry) { 282 xc_entry_add_ dmz(cache, entryslotid, stored_entry);282 xc_entry_add_unlocked(cache, entryslotid, stored_entry); 283 283 return stored_entry; 284 284 } … … 289 289 } 290 290 /* }}} */ 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) /* {{{ */291 static 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 /* }}} */ 296 static 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 /* }}} */ 301 static void xc_entry_free_real_unlocked(xc_entry_type_t type, xc_cache_t *cache, volatile xc_entry_t *entry) /* {{{ */ 302 302 { 303 303 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); 305 305 } 306 306 cache->mem->handlers->free(cache->mem, (xc_entry_t *)entry); 307 307 } 308 308 /* }}} */ 309 static void xc_entry_free_ dmz(xc_entry_type_t type, xc_cache_t *cache, xc_entry_t *entry TSRMLS_DC) /* {{{ */309 static void xc_entry_free_unlocked(xc_entry_type_t type, xc_cache_t *cache, xc_entry_t *entry TSRMLS_DC) /* {{{ */ 310 310 { 311 311 cache->entries_count --; 312 312 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); 314 314 } 315 315 else { … … 322 322 } 323 323 /* }}} */ 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) /* {{{ */324 static 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) /* {{{ */ 325 325 { 326 326 xc_entry_t **pp = &(cache->entries[entryslotid]); 327 327 xc_entry_t *p; 328 328 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)) { 330 330 /* unlink */ 331 331 *pp = p->next; 332 xc_entry_free_ dmz(type, cache, entry TSRMLS_CC);332 xc_entry_free_unlocked(type, cache, entry TSRMLS_CC); 333 333 return; 334 334 } … … 337 337 } 338 338 /* }}} */ 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) /* {{{ */339 static 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) /* {{{ */ 340 340 { 341 341 xc_entry_t *p; 342 342 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)) { 344 344 zend_bool fresh; 345 345 switch (type) { … … 368 368 } 369 369 370 xc_entry_remove_ dmz(type, cache, entryslotid, p TSRMLS_CC);370 xc_entry_remove_unlocked(type, cache, entryslotid, p TSRMLS_CC); 371 371 return NULL; 372 372 } … … 375 375 } 376 376 /* }}} */ 377 static void xc_entry_hold_php_ dmz(xc_cache_t *cache, xc_entry_php_t *entry TSRMLS_DC) /* {{{ */377 static void xc_entry_hold_php_unlocked(xc_cache_t *cache, xc_entry_php_t *entry TSRMLS_DC) /* {{{ */ 378 378 { 379 379 TRACE("hold %d:%s", entry->file_inode, entry->entry.name.str.val); … … 413 413 } 414 414 /* }}} */ 415 static void xc_cache_hit_ dmz(xc_cache_t *cache TSRMLS_DC) /* {{{ */415 static void xc_cache_hit_unlocked(xc_cache_t *cache TSRMLS_DC) /* {{{ */ 416 416 { 417 417 cache->hits ++; … … 434 434 /* helper function that loop through each entry */ 435 435 #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) /* {{{ */436 typedef XC_ENTRY_APPLY_FUNC((*cache_apply_unlocked_func_t)); 437 static void xc_entry_apply_unlocked(xc_entry_type_t type, xc_cache_t *cache, cache_apply_dmz_func_t apply_func TSRMLS_DC) /* {{{ */ 438 438 { 439 439 xc_entry_t *p, **pp; … … 446 446 /* unlink */ 447 447 *pp = p->next; 448 xc_entry_free_ dmz(type, cache, p TSRMLS_CC);448 xc_entry_free_unlocked(type, cache, p TSRMLS_CC); 449 449 } 450 450 else { … … 458 458 #define XC_CACHE_APPLY_FUNC(name) void name(xc_cache_t *cache TSRMLS_DC) 459 459 /* call graph: 460 * xc_gc_expires_php -> xc_gc_expires_one -> xc_entry_apply_ dmz-> xc_gc_expires_php_entry_dmz461 * xc_gc_expires_var -> xc_gc_expires_one -> xc_entry_apply_ dmz-> xc_gc_expires_var_entry_dmz460 * 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 462 462 */ 463 static XC_ENTRY_APPLY_FUNC(xc_gc_expires_php_entry_ dmz) /* {{{ */463 static XC_ENTRY_APPLY_FUNC(xc_gc_expires_php_entry_unlocked) /* {{{ */ 464 464 { 465 465 TRACE("ttl %lu, %lu %lu", (zend_ulong) XG(request_time), (zend_ulong) entry->atime, xc_php_ttl); … … 470 470 } 471 471 /* }}} */ 472 static XC_ENTRY_APPLY_FUNC(xc_gc_expires_var_entry_ dmz) /* {{{ */472 static XC_ENTRY_APPLY_FUNC(xc_gc_expires_var_entry_unlocked) /* {{{ */ 473 473 { 474 474 if (VAR_ENTRY_EXPIRED(entry)) { … … 478 478 } 479 479 /* }}} */ 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) /* {{{ */480 static 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) /* {{{ */ 481 481 { 482 482 TRACE("interval %lu, %lu %lu", (zend_ulong) XG(request_time), (zend_ulong) cache->last_gc_expires, gc_interval); … … 485 485 if (XG(request_time) - cache->last_gc_expires >= gc_interval) { 486 486 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); 488 488 } 489 489 } LEAVE_LOCK(cache); … … 500 500 501 501 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_ dmzTSRMLS_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); 503 503 } 504 504 } … … 513 513 514 514 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_ dmzTSRMLS_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 520 static XC_CACHE_APPLY_FUNC(xc_gc_delete_unlocked) /* {{{ */ 521 521 { 522 522 xc_entry_t *p, **pp; … … 533 533 *pp = p->next; 534 534 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); 536 536 } 537 537 else { … … 547 547 if (cache->deletes && XG(request_time) - cache->last_gc_deletes > xc_deletes_gc_interval) { 548 548 cache->last_gc_deletes = XG(request_time); 549 xc_gc_delete_ dmz(cache TSRMLS_CC);549 xc_gc_delete_unlocked(cache TSRMLS_CC); 550 550 } 551 551 } LEAVE_LOCK(cache); … … 572 572 573 573 /* helper functions for user functions */ 574 static void xc_fillinfo_ dmz(int cachetype, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */574 static void xc_fillinfo_unlocked(int cachetype, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */ 575 575 { 576 576 zval *blocks, *hits; … … 647 647 } 648 648 /* }}} */ 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) /* {{{ */649 static 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) /* {{{ */ 650 650 { 651 651 zval* ei; … … 717 717 } 718 718 /* }}} */ 719 static void xc_filllist_ dmz(xc_entry_type_t type, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */719 static void xc_filllist_unlocked(xc_entry_type_t type, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */ 720 720 { 721 721 zval* list; … … 728 728 for (i = 0, c = cache->hentry->size; i < c; i ++) { 729 729 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); 731 731 } 732 732 } … … 736 736 array_init(list); 737 737 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); 739 739 } 740 740 add_assoc_zval(return_value, "deleted_list", list); … … 990 990 } xc_entry_find_include_path_data_t; 991 991 /* }}} */ 992 static XC_INCLUDE_PATH_XSTAT_FUNC(xc_entry_find_include_path_func_ dmz) /* {{{ */992 static XC_INCLUDE_PATH_XSTAT_FUNC(xc_entry_find_include_path_func_unlocked) /* {{{ */ 993 993 { 994 994 xc_entry_find_include_path_data_t *entry_find_include_path_data = (xc_entry_find_include_path_data_t *) data; … … 998 998 compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val); 999 999 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( 1001 1001 XC_TYPE_PHP 1002 1002 , xc_php_caches[compiler->entry_hash.cacheid] … … 1008 1008 } 1009 1009 /* }}} */ 1010 static int xc_entry_find_include_path_ dmz(xc_compiler_t *compiler, const char *filepath, xc_entry_php_t **stored_entry TSRMLS_DC) /* {{{ */1010 static int xc_entry_find_include_path_unlocked(xc_compiler_t *compiler, const char *filepath, xc_entry_php_t **stored_entry TSRMLS_DC) /* {{{ */ 1011 1011 { 1012 1012 char path_buffer[MAXPATHLEN]; … … 1015 1015 entry_find_include_path_data.stored_entry = stored_entry; 1016 1016 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) 1018 1018 ? SUCCESS 1019 1019 : FAILURE; … … 1903 1903 1904 1904 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) { 1906 1906 compiler->opened_path = compiler->new_entry.entry.name.str.val; 1907 1907 } … … 1916 1916 compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val); 1917 1917 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); 1919 1919 } 1920 1920 1921 1921 if (stored_entry) { 1922 xc_cache_hit_ dmz(cache TSRMLS_CC);1922 xc_cache_hit_unlocked(cache TSRMLS_CC); 1923 1923 1924 1924 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); 1926 1926 stored_php = stored_entry->php; 1927 1927 break; … … 1936 1936 } 1937 1937 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); 1939 1939 1940 1940 if (stored_php) { 1941 1941 compiler->new_entry.php = stored_php; 1942 xc_php_addref_ dmz(stored_php);1942 xc_php_addref_unlocked(stored_php); 1943 1943 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); 1945 1945 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); 1947 1947 break; 1948 1948 } … … 2015 2015 ENTER_LOCK_EX(cache) { /* {{{ php_store/entry_store */ 2016 2016 /* 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); 2018 2018 if (!stored_php) { 2019 2019 /* error */ … … 2022 2022 /* entry_store */ 2023 2023 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); 2026 2026 if (!stored_entry) { 2027 xc_php_release_ dmz(cache, stored_php);2027 xc_php_release_unlocked(cache, stored_php); 2028 2028 } 2029 2029 } LEAVE_LOCK_EX(cache); … … 2672 2672 ENTER_LOCK(cache) { 2673 2673 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); 2675 2675 } 2676 2676 else { 2677 xc_filllist_ dmz(type, cache, return_value TSRMLS_CC);2677 xc_filllist_unlocked(type, cache, return_value TSRMLS_CC); 2678 2678 } 2679 2679 } LEAVE_LOCK(cache); … … 2694 2694 for (e = cache->entries[entryslotid]; e; e = next) { 2695 2695 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); 2697 2697 } 2698 2698 cache->entries[entryslotid] = NULL; … … 2792 2792 2793 2793 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); 2795 2795 if (stored_entry_var) { 2796 2796 /* return */ 2797 2797 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); 2799 2799 } 2800 2800 else { … … 2834 2834 2835 2835 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); 2837 2837 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); 2839 2839 } 2840 2840 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); 2842 2842 } LEAVE_LOCK(cache); 2843 2843 } … … 2864 2864 2865 2865 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); 2867 2867 if (stored_entry_var) { 2868 xc_cache_hit_ dmz(cache TSRMLS_CC);2868 xc_cache_hit_unlocked(cache TSRMLS_CC); 2869 2869 RETVAL_TRUE; 2870 2870 /* return */ … … 2898 2898 2899 2899 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); 2901 2901 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); 2903 2903 RETVAL_TRUE; 2904 2904 } … … 2933 2933 for (entry = cache->entries[entryslotid]; entry; entry = next) { 2934 2934 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); 2937 2937 } 2938 2938 } … … 2971 2971 2972 2972 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); 2974 2974 if (stored_entry_var) { 2975 2975 TRACE("incdec: got entry_var %s", entry_var.entry.name.str.val); … … 3007 3007 entry_var.entry.ctime = stored_entry_var->entry.ctime; 3008 3008 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); 3012 3012 } LEAVE_LOCK(cache); 3013 3013 }

