Skip to content

Instantly share code, notes, and snippets.

@jbarciauskas
Created August 8, 2012 21:30
Show Gist options
  • Save jbarciauskas/3298944 to your computer and use it in GitHub Desktop.
Save jbarciauskas/3298944 to your computer and use it in GitHub Desktop.
try to get multiple locks in mysql
mysql> select get_lock('foo', 1200);
+-----------------------+
| get_lock('foo', 1200) |
+-----------------------+
| 1 |
+-----------------------+
1 row in set (0.00 sec)
mysql> select get_lock('bar', 1200);
+-----------------------+
| get_lock('bar', 1200) |
+-----------------------+
| 1 |
+-----------------------+
1 row in set (0.00 sec)
mysql> select release_lock('foo');
+---------------------+
| release_lock('foo') |
+---------------------+
| NULL |
+---------------------+
1 row in set (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment