Project

General

Profile

Bug #19112 » bug_8980.diff

Administrator Admin, 2010-09-09 16:38

View differences:

typo3_src.new/t3lib/class.t3lib_lock.php 2010-09-09 15:50:32.000000000 +0200
switch ($this->method) {
case 'simple':
if (is_file($this->resource)) {
if (is_file($this->resource))
$this->sysLog('Waiting for a different process to release the lock');
$i = 0;
while ($i<$this->loops) {
$i++;
usleep($this->step * 1000);
clearstatcache();
if (!is_file($this->resource)) { // Lock became free, leave the loop
$this->sysLog('Different process released the lock');
$noWait = FALSE;
break;
}
$isAcquired = false;
$noWait = True;
for ($i = 0; $i < $this->loops; $i++) {
$f = @fopen($this->resource, 'x');
if ($f !== FALSE) {
fclose($f);
$this->sysLog('Lock aquired');
$noWait = ($i == 0);
$isAcquired = true;
break;
}
} else {
$noWait = TRUE;
usleep($this->step * 1000);
}
if (($this->filepointer = touch($this->resource)) == FALSE) {
if (!$isAcquired)
throw new Exception('Lock file could not be created');
}
break;
case 'flock':
if (($this->filepointer = fopen($this->resource, 'w+')) == FALSE) {
......
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_lock.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_lock.php']);
}
?>
?>
(4-4/5)