diff options
author | Andrey Andreev <narf@devilix.net> | 2015-01-14 21:13:36 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-01-14 21:13:36 +0100 |
commit | 19c25249a9d4f379773d9def3390c2e44dde0a22 (patch) | |
tree | c8b49b72afe3ae40759333960617e563d1970f99 /system/libraries | |
parent | bf6b11d7d9732dbc46ca0ea897cfd4023fff7844 (diff) |
Fix #3473
I don't know why I thought of semaphores in the first place ...
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Session/Session_driver.php | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/system/libraries/Session/Session_driver.php b/system/libraries/Session/Session_driver.php index 944659c4c..de1908ac6 100644 --- a/system/libraries/Session/Session_driver.php +++ b/system/libraries/Session/Session_driver.php @@ -107,34 +107,16 @@ abstract class CI_Session_driver implements SessionHandlerInterface { /** * Get lock * - * A default locking mechanism via semaphores, if ext/sysvsem is available. - * - * Drivers will usually override this and only fallback to it if no other - * locking mechanism is available. + * A dummy method allowing drivers with no locking functionality + * (databases other than PostgreSQL and MySQL) to act as if they + * do acquire a lock. * * @param string $session_id * @return bool */ protected function _get_lock($session_id) { - if ( ! extension_loaded('sysvsem')) - { - $this->_lock = TRUE; - return TRUE; - } - - if (($this->_lock = sem_get($session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : ''), 1, 0644)) === FALSE) - { - return FALSE; - } - - if ( ! sem_acquire($this->_lock)) - { - sem_remove($this->_lock); - $this->_lock = FALSE; - return FALSE; - } - + $this->_lock = TRUE; return TRUE; } @@ -147,10 +129,8 @@ abstract class CI_Session_driver implements SessionHandlerInterface { */ protected function _release_lock() { - if (extension_loaded('sysvsem') && $this->_lock) + if ($this->_lock) { - sem_release($this->_lock); - sem_remove($this->_lock); $this->_lock = FALSE; } |