~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/locks.rst

Merge Revision revid:marko.makela@oracle.com-20100601140355-u3kxl0yl0ljl5tx9 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100601140355-u3kxl0yl0ljl5tx9

Original Authors: Marko Mäkelä <marko.makela@oracle.com>
Original commit message:
Merge a change from mysql-5.1-innodb:

  ------------------------------------------------------------
  revno: 3491
  revision-id: marko.makela@oracle.com-20100601134335-ccthwwru23kn09qw
  parent: marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Tue 2010-06-01 16:43:35 +0300
  message:
    Bug#48197: Concurrent rw_lock_free may cause assertion failure

    rw_lock_t: Remove magic_n unless UNIV_DEBUG is defined.
    rw_lock_free(): Invalidate magic_n only after removing from rw_lock_list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
User Defined Locks
2
 
===================
3
 
 
4
 
A user can create a "lock" which is scoped to their user space. Multiple
5
 
session of the user can see the lock.
6
 
 
7
 
SELECT GET_LOCK();
8
 
 
9
 
SELECT GET_LOCKS();
10
 
 
11
 
SELECT RELEASE_LOCK();
12
 
 
13
 
SELECT RELEASE_LOCK();
14
 
 
15
 
SELECT RELEASE_LOCKS();
16
 
 
17
 
SELECT is_free_lock();
18
 
 
19
 
SELECT is_used_lock();
20
 
 
21
 
If a session should exit, whatever locks it was holding will be deleted.
22
 
 
23
 
.. todo::
24
 
 
25
 
   deleted or released? are locks recursive?
26
 
 
27
 
Please note, get_lock() was designed to be compatible with MySQL. If you
28
 
hold any locks when calling get_lock() they will be released. For this
29
 
reason you may want to consider calling get_locks() instead.
30
 
 
31
 
Information on all barriers can be found in the DATA_DICTIONARY.USER_LOCKS
32
 
table;