1 | <?php |
||
37 | class MysqlMutex extends DbMutex |
||
38 | { |
||
39 | /** |
||
40 | * Initializes MySQL specific mutex component implementation. |
||
41 | * @throws InvalidConfigException if [[db]] is not MySQL connection. |
||
42 | */ |
||
43 | 2 | public function init() |
|
50 | |||
51 | /** |
||
52 | * Acquires lock by given name. |
||
53 | * @param string $name of the lock to be acquired. |
||
54 | * @param int $timeout to wait for lock to become released. |
||
55 | * @return bool acquiring result. |
||
56 | * @see http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_get-lock |
||
57 | */ |
||
58 | 2 | protected function acquireLock($name, $timeout = 0) |
|
64 | |||
65 | /** |
||
66 | * Releases lock by given name. |
||
67 | * @param string $name of the lock to be released. |
||
68 | * @return bool release result. |
||
69 | * @see http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_release-lock |
||
70 | */ |
||
71 | 1 | protected function releaseLock($name) |
|
77 | } |
||
78 |