Changes between Version 13 and Version 14 of XcacheApi


Ignore:
Timestamp:
2007-07-05T16:26:52+02:00 (8 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • XcacheApi

    v13 v14  
    5252#!php
    5353<?php
     54define(TMPDIR, '/tmp');
    5455
    5556function load_abc_data()
     
    5859    return xcache_get("abc_data");
    5960  }
    60   // it worth lock here
    61   $fp = fopen(TMPDIR . "/abc_data.lock");
     61  // it worth a lock here to avoid useless yet harmful concurrent load from any slow backend (backend=mysql here).
     62  $fp = fopen(TMPDIR . "/abc_data.lock", "w");
    6263  flock($fp, LOCK_EX);
    6364  // check AGAIN after we get the lock