1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge remote-tracking branch 'merge/merge-perfschema-5.6' into 10.0

This commit is contained in:
Vicențiu Ciorbaru
2017-01-10 12:32:54 +02:00
5 changed files with 131 additions and 66 deletions

View File

@@ -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
@@ -155,6 +155,18 @@ struct pfs_lock
PFS_atomic::store_u32(&m_version_state, new_val);
}
/**
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.