summaryrefslogtreecommitdiff
path: root/storage/innobase/include/buf0buf.h
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/include/buf0buf.h')
-rw-r--r--storage/innobase/include/buf0buf.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 9136c25acfd..33612f85ed6 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -41,6 +41,7 @@ Created 11/5/1995 Heikki Tuuri
#include "os0proc.h"
#include "log0log.h"
#include "srv0srv.h"
+#include "my_atomic.h"
#include <ostream>
// Forward declaration
@@ -1506,8 +1507,10 @@ NOTE! The definition appears here only for other modules of this
directory (buf) to see it. Do not use from outside! */
typedef struct {
- bool reserved; /*!< true if this slot is reserved
+private:
+ int32 reserved; /*!< true if this slot is reserved
*/
+public:
byte* crypt_buf; /*!< for encryption the data needs to be
copied to a separate buffer before it's
encrypted&written. this as a page can be
@@ -1518,6 +1521,21 @@ typedef struct {
byte* out_buf; /*!< resulting buffer after
encryption/compression. This is a
pointer and not allocated. */
+
+ /** Release the slot */
+ void release()
+ {
+ my_atomic_store32_explicit(&reserved, false,
+ MY_MEMORY_ORDER_RELAXED);
+ }
+
+ /** Acquire the slot
+ @return whether the slot was acquired */
+ bool acquire()
+ {
+ return !my_atomic_fas32_explicit(&reserved, true,
+ MY_MEMORY_ORDER_RELAXED);
+ }
} buf_tmp_buffer_t;
/** The common buffer control block structure