MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DictLock.hpp
1 /*
2  Copyright (C) 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef DICT_LOCK_HPP
20 #define DICT_LOCK_HPP
21 
22 #include "SignalData.hpp"
23 
24 // see comments in Dbdict.hpp
25 
26 class DictLockReq {
27  friend class Dbdict;
28  friend class Dbdih;
29  friend class Suma;
30 public:
31  STATIC_CONST( SignalLength = 3 );
32  enum LockType {
33  NoLock = 0
34  ,NodeRestartLock = 1 // S-lock
35  ,NodeFailureLock = 2 // S-lock
36  ,SchemaTransLock = 3
37  // non-trans op locks
38  ,CreateFileLock = 8
39  ,CreateFilegroupLock = 9
40  ,DropFileLock = 10
41  ,DropFilegroupLock = 11
42  ,SumaStartMe = 12
43  ,SumaHandOver = 13
44  };
45 private:
46  Uint32 userPtr;
47  Uint32 lockType;
48  Uint32 userRef;
49 };
50 
51 class DictLockConf {
52  friend class Dbdict;
53  friend class Dbdih;
54  friend class Suma;
55 public:
56  STATIC_CONST( SignalLength = 3 );
57 private:
58  Uint32 userPtr;
59  Uint32 lockType;
60  Uint32 lockPtr;
61 };
62 
63 class DictLockRef {
64  friend class Dbdict;
65  friend class Dbdih;
66  friend class Suma;
67 public:
68  STATIC_CONST( SignalLength = 3 );
69  enum ErrorCode {
70  NotMaster = 1,
71  InvalidLockType = 2,
72  BadUserRef = 3,
73  TooLate = 4,
74  TooManyRequests = 5
75  };
76 private:
77  Uint32 userPtr;
78  Uint32 lockType;
79  Uint32 errorCode;
80 };
81 
83  friend class Dbdict;
84  friend class Dbdih;
85  friend class Suma;
86 public:
87  STATIC_CONST( SignalLength = 4 );
88 
89  Uint32 lockPtr;
90  Uint32 lockType;
91  Uint32 senderData;
92  Uint32 senderRef;
93 };
94 
95 #endif