Project

General

Profile

Bug #18084 » bug_7333_debug.diff

Administrator Admin, 2008-02-08 23:08

View differences:

t3lib/class.t3lib_lock.php (Arbeitskopie)
switch ($this->method) {
case 'simple':
debug('Trying to acquire lock...');
if (is_file($this->id)) {
debug('Waiting for lock "'.basename($this->id).'" to become available...');
$i = 0;
while ($i<$this->loops) {
$i++;
......
break;
}
}
if ($noWait==true) {
debug('Error: Lock is still active, but timeout is reached.');
}
} else {
debug('Lock "'.basename($this->id).'" was successfully acquired.');
$noWait = true;
}
......
$success = true;
switch ($this->method) {
case 'simple':
debug('Lock "'.basename($this->id).'" has been released.');
if (unlink($this->id) == false) {
debug('Error: File "'.basename($this->id).'" could not be removed.');
$success = false;
}
break;
typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie)
$cc = $this->tmpl->getCurrentPageData();
if (!is_array($cc)) {
debug('pagesection was not found in cache. Try to acquire lock and if successful, build the template.');
$key = $this->id.'::'.$this->MP;
$isLocked = $this->acquirePageGenerationLock($this->pagesection_lockObj, $key); // Returns true if the lock is active now
if (!$isLocked) { // Lock is no longer active, the data in "cache_pagesection" is now ready
debug('Seems like we had to wait, and the lock is now released. Try to read from cache_pagesection again.');
$cc = $this->tmpl->getCurrentPageData();
if (is_array($cc)) {
debug('pagesection was successfully read from cache. Lock which was acquired is no longer needed.');
$this->releasePageGenerationLock($this->pagesection_lockObj); // Release the lock
}
} else {
debug('Successfully acquired lock. Start building the template.');
}
}
......
$lockHash = $this->getLockHash();
if ($this->all) {
debug('pagesection was found in cache. Try to read the pages record from cache, too...');
$this->newHash = $this->getHash();
$GLOBALS['TT']->push('Cache Row','');
$row = $this->getFromCache_queryRow();
if (!is_array($row)) {
debug('pages record was not found in cache. Try to acquire lock and if successful, build the page.');
$isLocked = $this->acquirePageGenerationLock($this->pages_lockObj, $lockHash);
if (!$isLocked) { // Lock is no longer active, the data in "cache_pages" is now ready
debug('Seems like we had to wait, and the lock is now released. Try to read from cache_pages again.');
$row = $this->getFromCache_queryRow();
if (is_array($row)) {
debug('pages record was successfully read from cache. Lock which was acquired is no longer needed.');
$this->releasePageGenerationLock($this->pages_lockObj); // Release the lock
}
} else {
debug('Successfully acquired lock. Start building the page.');
}
}
if (is_array($row)) {
// Release this lock
$this->releasePageGenerationLock($this->pages_lockObj);
$this->config = (array)unserialize($row['cache_data']); // Fetches the lowlevel config stored with the cached data
$this->content = $row['HTML']; // Getting the content
$this->tempContent = $row['temp_content']; // Flag for temp content
......
$GLOBALS['TT']->pull();
} else {
debug('pagesection was not found in cache, so we need to build both pagesection and page. Acquiring lock...');
$this->acquirePageGenerationLock($this->pages_lockObj, $lockHash);
}
}
......
}
// Release open locks
debug('Releasing all existing locks.');
$this->releasePageGenerationLock($this->pagesection_lockObj);
$this->releasePageGenerationLock($this->pages_lockObj);
(2-2/4)