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