summaryrefslogtreecommitdiff
path: root/storage/innobase/include/lock0types.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/lock0types.h')
-rw-r--r--storage/innobase/include/lock0types.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/storage/innobase/include/lock0types.h b/storage/innobase/include/lock0types.h
index cf32e72f864..d08eaabfb1e 100644
--- a/storage/innobase/include/lock0types.h
+++ b/storage/innobase/include/lock0types.h
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1996, 2009, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -23,12 +23,16 @@ The transaction lock system global types
Created 5/7/1996 Heikki Tuuri
*******************************************************/
+#include "ut0lst.h"
+
#ifndef lock0types_h
#define lock0types_h
#define lock_t ib_lock_t
+
struct lock_t;
struct lock_sys_t;
+struct lock_table_t;
/* Basic lock modes */
enum lock_mode {
@@ -43,5 +47,32 @@ enum lock_mode {
LOCK_NONE_UNSET = 255
};
+/** Convert the given enum value into string.
+@param[in] mode the lock mode
+@return human readable string of the given enum value */
+inline
+const char* lock_mode_string(enum lock_mode mode)
+{
+ switch (mode) {
+ case LOCK_IS:
+ return("LOCK_IS");
+ case LOCK_IX:
+ return("LOCK_IX");
+ case LOCK_S:
+ return("LOCK_S");
+ case LOCK_X:
+ return("LOCK_X");
+ case LOCK_AUTO_INC:
+ return("LOCK_AUTO_INC");
+ case LOCK_NONE:
+ return("LOCK_NONE");
+ case LOCK_NONE_UNSET:
+ return("LOCK_NONE_UNSET");
+ default:
+ ut_error;
+ }
+}
+
+typedef UT_LIST_BASE_NODE_T(lock_t) trx_lock_list_t;
-#endif
+#endif /* lock0types_h */