1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-05 16:15:50 +03:00
Files
mariadb-columnstore-engine/versioning/BRM/lbidresourcegraph.h
Leonid Fedorov 82421c208f chore(ci): collect asan ubsan and libc++ build with mtr and regression status ignored (#3672)
* MSan added with fixes for libc++

* libc++ sepatare build

* add libc++ to ci

* libstdc++ in CI

* libcpp and msan to external projects

* std::sqrt

* awful_hack(ci): install whole llvm instead of libc++ in terrible way for test containers

* Adding ddeb packages for teststages and repos

* libc++ more for test container

* save some money on debug

* colored coredumps

* revert ci

* chore(ci): collect asan ubsan and libc++ build with mtr and regression status ignored
2025-07-31 00:32:32 +04:00

75 lines
2.0 KiB
C++

/* Copyright (C) 2014 InfiniDB, Inc.
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 Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/******************************************************************************
* $Id: lbidresourcegraph.h 1823 2013-01-21 14:13:09Z rdempsey $
*
*****************************************************************************/
/** @file
* class XXX interface
*/
#pragma once
#include <map>
#include <set>
#include <unordered.h>
#include <boost/thread.hpp>
#include "brmtypes.h"
#include "transactionnode.h"
#include "resourcenode.h"
#define EXPORT
namespace BRM
{
class LBIDResourceGraph
{
public:
typedef std::tr1::unordered_set<ResourceNode*, RNHasher, RNEquals> RNodes_t;
EXPORT LBIDResourceGraph();
EXPORT ~LBIDResourceGraph();
EXPORT int reserveRange(LBID_t start, LBID_t end, VER_t txn, boost::mutex& mutex);
/// releases all resources held by txn
EXPORT void releaseResources(VER_t txn);
/// releases one resource
EXPORT void releaseResource(LBID_t start);
private:
uint64_t color;
LBIDResourceGraph(const LBIDResourceGraph&) = delete;
LBIDResourceGraph& operator=(const LBIDResourceGraph&) = delete;
void connectResources(LBID_t start, LBID_t end, TransactionNode* txnNode);
bool checkDeadlock(TransactionNode&);
bool DFSStep(RGNode*, uint64_t, uint64_t) const;
std::map<VER_t, TransactionNode*> txns;
RNodes_t resources;
};
} // namespace BRM
#undef EXPORT