Make WordPress Core


Ignore:
Timestamp:
11/17/2005 09:30:14 AM (21 years ago)
Author:
ryan
Message:

Don't bother with sems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/cache.php

    r3123 r3131  
    5555        var $cache_enabled = false;
    5656        var $expiration_time = 86400;
    57         var $use_flock = false;
    5857        var $flock_filename = 'wp_object_cache.lock';
    59         var $sem_id = 5454;
    60         var $mutex;
    6158        var $cache = array ();
    6259        var $dirty_objects = array ();
     
    282279                }
    283280
    284                 // Acquire a write lock.  Semaphore preferred.  Fallback to flock.
    285                 if (function_exists('sem_get')) {
    286                         $this->use_flock = false;
    287                         $mutex = sem_get($this->sem_id, 1, 0644 | IPC_CREAT, 1);
    288                         sem_acquire($mutex);
    289                 } else {
    290                         $this->use_flock = true;
    291                         $mutex = fopen($this->cache_dir.$this->flock_filename, 'w');
    292                         flock($mutex, LOCK_EX);
    293                 }
     281                // Acquire a write lock.
     282                $mutex = fopen($this->cache_dir.$this->flock_filename, 'w');
     283                flock($mutex, LOCK_EX);
    294284
    295285                // Loop over dirty objects and save them.
     
    322312
    323313                // Release write lock.
    324                 if ($this->use_flock)
    325                         flock($mutex, LOCK_UN);
    326                 else
    327                         sem_release($mutex);
     314                flock($mutex, LOCK_UN);
     315                fclose($mutex);
    328316        }
    329317
Note: See TracChangeset for help on using the changeset viewer.