Changeset 394
- Timestamp:
- 02/04/10 11:31:26 (6 months ago)
- Files:
-
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/eaccelerator.c (modified) (3 diffs)
- eaccelerator/trunk/eaccelerator.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ChangeLog
r393 r394 1 2010-02-04 Bart Vanbrabant <bart at vanbrabant.eu> 2 3 * Remove some leftovers from the lock api 4 1 5 2010-02-03 Bart Vanbrabant <bart at vanbrabant.eu> 2 6 eaccelerator/trunk/eaccelerator.c
r391 r394 259 259 ea_mm_instance->check_mtime_enabled = 1; 260 260 ea_mm_instance->removed = NULL; 261 ea_mm_instance->locks = NULL;262 261 ea_mm_instance->last_prune = time(NULL); /* this time() call is harmless since this is init phase */ 263 262 EACCELERATOR_PROTECT(); … … 1501 1500 if (ea_mm_instance != NULL) { 1502 1501 EACCELERATOR_UNPROTECT(); 1503 if (p != NULL || ea_mm_instance->locks != NULL) {1502 if (p != NULL) { 1504 1503 EACCELERATOR_LOCK_RW(); 1505 1504 while (p != NULL) { … … 1525 1524 } 1526 1525 p = p->next; 1527 }1528 if (ea_mm_instance->locks != NULL) {1529 pid_t pid = getpid();1530 #ifdef ZTS1531 THREAD_T thread = tsrm_thread_id();1532 #endif1533 ea_lock_entry** p = &ea_mm_instance->locks;1534 while ((*p) != NULL) {1535 #ifdef ZTS1536 if ((*p)->pid == pid && (*p)->thread == thread) {1537 #else1538 if ((*p)->pid == pid) {1539 #endif1540 ea_lock_entry* x = *p;1541 *p = (*p)->next;1542 eaccelerator_free_nolock(x);1543 } else {1544 p = &(*p)->next;1545 }1546 }1547 1526 } 1548 1527 EACCELERATOR_UNLOCK_RW(); eaccelerator/trunk/eaccelerator.h
r385 r394 308 308 } ea_used_entry; 309 309 310 /*311 * Linked list of locks312 */313 typedef struct _ea_lock_entry {314 struct _ea_lock_entry *next;315 pid_t pid;316 #ifdef ZTS317 THREAD_T thread;318 #endif319 char key[1];320 } ea_lock_entry;321 322 310 typedef struct _ea_file_header { 323 311 char magic[8]; /* "EACCELERATOR" */ … … 345 333 time_t last_prune; 346 334 ea_cache_entry *removed; 347 ea_lock_entry *locks;348 335 349 336 ea_cache_entry *hash[EA_HASH_SIZE]; … … 394 381 void format_size (char *s, unsigned int size, int legend); 395 382 void eaccelerator_prune (time_t t); 396 397 int eaccelerator_lock (const char *key, int key_len TSRMLS_DC);398 int eaccelerator_unlock (const char *key, int key_len TSRMLS_DC);399 383 400 384 void *eaccelerator_malloc2 (size_t size TSRMLS_DC);