Changeset 11171
- Timestamp:
- 05/05/08 19:01:53 (5 years ago)
- Files:
-
- 1 modified
-
lang/php/misc/single_execution.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/misc/single_execution.php
r11169 r11171 63 63 } 64 64 65 $this->unlockIfInvalid($key); 66 65 67 $lock_directory = $this->lockDirectory($key); 66 67 if (!$this->isInvalidLock($lock_directory)) {68 $this->unlock($key);69 }70 68 71 69 if (!$this->mkdir($lock_directory)) { … … 154 152 $this->unlock($this->key); 155 153 exit; 154 } 155 156 function unlockIfInvalid($key) 157 { 158 $common_key = 'common'; 159 160 // spin lock 161 $common_lock = $this->lockDirectory($common_key); 162 while (!$this->mkdir($common_lock)) { 163 usleep(10000); 164 } 165 166 // critical section 167 if (!$this->isInvalidLock($this->lockDirectory($key))) { 168 $this->unlock($key); 169 } 170 171 // unlock 172 $this->unlock($common_key); 156 173 } 157 174
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)