Changeset 394

Show
Ignore:
Timestamp:
02/04/10 11:31:26 (6 months ago)
Author:
bart
Message:

Remove some leftovers from the lock api

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r393 r394  
     12010-02-04      Bart Vanbrabant <bart at vanbrabant.eu> 
     2 
     3                * Remove some leftovers from the lock api 
     4 
    152010-02-03      Bart Vanbrabant <bart at vanbrabant.eu> 
    26 
  • eaccelerator/trunk/eaccelerator.c

    r391 r394  
    259259  ea_mm_instance->check_mtime_enabled = 1; 
    260260  ea_mm_instance->removed = NULL; 
    261   ea_mm_instance->locks = NULL; 
    262261  ea_mm_instance->last_prune = time(NULL);      /* this time() call is harmless since this is init phase */ 
    263262  EACCELERATOR_PROTECT(); 
     
    15011500  if (ea_mm_instance != NULL) { 
    15021501    EACCELERATOR_UNPROTECT(); 
    1503     if (p != NULL || ea_mm_instance->locks != NULL) { 
     1502    if (p != NULL) { 
    15041503      EACCELERATOR_LOCK_RW(); 
    15051504      while (p != NULL) { 
     
    15251524        } 
    15261525        p = p->next; 
    1527       } 
    1528       if (ea_mm_instance->locks != NULL) { 
    1529         pid_t    pid    = getpid(); 
    1530 #ifdef ZTS 
    1531         THREAD_T thread = tsrm_thread_id(); 
    1532 #endif 
    1533         ea_lock_entry** p = &ea_mm_instance->locks; 
    1534         while ((*p) != NULL) { 
    1535 #ifdef ZTS 
    1536           if ((*p)->pid == pid && (*p)->thread == thread) { 
    1537 #else 
    1538           if ((*p)->pid == pid) { 
    1539 #endif 
    1540             ea_lock_entry* x = *p; 
    1541             *p = (*p)->next; 
    1542             eaccelerator_free_nolock(x); 
    1543           } else { 
    1544             p = &(*p)->next; 
    1545           } 
    1546         } 
    15471526      } 
    15481527      EACCELERATOR_UNLOCK_RW(); 
  • eaccelerator/trunk/eaccelerator.h

    r385 r394  
    308308} ea_used_entry; 
    309309 
    310 /* 
    311  * Linked list of locks 
    312  */ 
    313 typedef struct _ea_lock_entry { 
    314         struct _ea_lock_entry *next; 
    315         pid_t pid; 
    316 #ifdef ZTS 
    317         THREAD_T thread; 
    318 #endif 
    319         char key[1]; 
    320 } ea_lock_entry; 
    321  
    322310typedef struct _ea_file_header { 
    323311        char magic[8];                          /* "EACCELERATOR" */ 
     
    345333        time_t last_prune; 
    346334        ea_cache_entry *removed; 
    347         ea_lock_entry *locks; 
    348335 
    349336        ea_cache_entry *hash[EA_HASH_SIZE]; 
     
    394381void format_size (char *s, unsigned int size, int legend); 
    395382void 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); 
    399383 
    400384void *eaccelerator_malloc2 (size_t size TSRMLS_DC);