Changes between Version 13 and Version 14 of XcacheApi
- Timestamp:
- 07/05/2007 04:26:52 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XcacheApi
v13 v14 52 52 #!php 53 53 <?php 54 define(TMPDIR, '/tmp'); 54 55 55 56 function load_abc_data() … … 58 59 return xcache_get("abc_data"); 59 60 } 60 // it worth lock here61 $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"); 62 63 flock($fp, LOCK_EX); 63 64 // check AGAIN after we get the lock

