MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AccLock.hpp
1 /*
2  Copyright (C) 2003, 2005, 2006 MySQL AB
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 ACC_LOCK_HPP
20 #define ACC_LOCK_HPP
21 
22 #include "SignalData.hpp"
23 
24 /*
25  * Lock or unlock tuple. If lock request is queued, the reply is later
26  * via ACCKEYCONF.
27  */
28 class AccLockReq {
29  friend class Dbacc;
30  friend class Dbtup;
31  friend class Dbtux;
32  friend bool printACC_LOCKREQ(FILE *, const Uint32*, Uint32, Uint16);
33 public:
34  enum RequestType { // first byte
35  LockShared = 1,
36  LockExclusive = 2,
37  Unlock = 3,
38  Abort = 4,
39  AbortWithConf = 5
40  };
41  enum RequestFlag { // second byte
42  };
43  enum ReturnCode {
44  Success = 0,
45  IsBlocked = 1, // was put in lock queue
46  WouldBlock = 2, // if we add non-blocking option
47  Refused = 3,
48  NoFreeOp = 4
49  };
50  STATIC_CONST( LockSignalLength = 13 );
51  STATIC_CONST( UndoSignalLength = 3 );
52 private:
53  Uint32 returnCode;
54  Uint32 requestInfo;
55  Uint32 accOpPtr;
56  // rest only if lock request
57  Uint32 userPtr;
58  Uint32 userRef;
59  Uint32 tableId;
60  Uint32 fragId;
61  Uint32 fragPtrI;
62  Uint32 hashValue;
63  Uint32 page_id;
64  Uint32 page_idx;
65  Uint32 transId1;
66  Uint32 transId2;
67 };
68 
69 #endif