summaryrefslogtreecommitdiff
path: root/storage/perfschema/pfs_lock.h
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-01-07 15:53:37 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-01-07 15:53:37 +0200
commitc33db2cdc0ab70a874060d58710895f6dac3dea3 (patch)
tree4180a0fa39bd57256b64434b189e9514f4e4c601 /storage/perfschema/pfs_lock.h
parentae473368feea7dc75f10624495eb210ae10e1c05 (diff)
downloadmariadb-git-c33db2cdc0ab70a874060d58710895f6dac3dea3.tar.gz
5.6.35
Diffstat (limited to 'storage/perfschema/pfs_lock.h')
-rw-r--r--storage/perfschema/pfs_lock.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h
index c429d934702..339a893c833 100644
--- a/storage/perfschema/pfs_lock.h
+++ b/storage/perfschema/pfs_lock.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2016, 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
@@ -156,6 +156,18 @@ struct pfs_lock
}
/**
+ Initialize a lock to dirty.
+ */
+ void set_dirty(void)
+ {
+ /* Do not set the version to 0, read the previous value. */
+ uint32 copy= PFS_atomic::load_u32(&m_version_state);
+ /* Increment the version, set the DIRTY state */
+ uint32 new_val= (copy & VERSION_MASK) + VERSION_INC + PFS_LOCK_DIRTY;
+ PFS_atomic::store_u32(&m_version_state, new_val);
+ }
+
+ /**
Execute a dirty to free transition.
This transition should be executed by the writer that owns the record.
*/