From 33adfcea91b45a5287bacfdf26b4bf30e69acd6c Mon Sep 17 00:00:00 2001 From: resurtm Date: Tue, 25 Jun 2013 07:24:57 +0600 Subject: [PATCH] Autorelease callback. --- extensions/mutex/yii/mutex/Mutex.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/mutex/yii/mutex/Mutex.php b/extensions/mutex/yii/mutex/Mutex.php index 14ebf8f..c7413a1 100644 --- a/extensions/mutex/yii/mutex/Mutex.php +++ b/extensions/mutex/yii/mutex/Mutex.php @@ -34,10 +34,11 @@ abstract class Mutex extends Component { if ($this->autoRelease) { $referenceHolder = new stdClass(); + $referenceHolder->mutex = &$this; $referenceHolder->locks = &$this->_locks; register_shutdown_function(function ($ref) { foreach ($ref->locks as $lock) { - $this->release($lock); + $ref->mutex->release($lock); } }, $referenceHolder); }