You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-27 21:01:50 +03:00
the begginning
This commit is contained in:
77
versioning/BRM/transactionnode.cpp
Normal file
77
versioning/BRM/transactionnode.cpp
Normal file
@ -0,0 +1,77 @@
|
||||
/* 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: transactionnode.cpp 1823 2013-01-21 14:13:09Z rdempsey $
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/condition.hpp>
|
||||
|
||||
#define TRANSACTIONNODE_DLLEXPORT
|
||||
#include "transactionnode.h"
|
||||
#undef TRANSACTIONNODE_DLLEXPORT
|
||||
|
||||
namespace BRM {
|
||||
|
||||
TransactionNode::TransactionNode(int txn) : txnID(txn), _die(false), _sleeping(false)
|
||||
{
|
||||
}
|
||||
|
||||
TransactionNode::~TransactionNode()
|
||||
{
|
||||
}
|
||||
|
||||
void TransactionNode::setTxnID(VER_t txn)
|
||||
{
|
||||
txnID = txn;
|
||||
}
|
||||
|
||||
int TransactionNode::getTxnID() const
|
||||
{
|
||||
return txnID;
|
||||
}
|
||||
|
||||
void TransactionNode::sleep(boost::mutex &mutex)
|
||||
{
|
||||
_sleeping = true;
|
||||
condVar.wait(mutex);
|
||||
}
|
||||
|
||||
void TransactionNode::wake()
|
||||
{
|
||||
condVar.notify_one();
|
||||
_sleeping = false;
|
||||
}
|
||||
|
||||
void TransactionNode::die()
|
||||
{
|
||||
_die = true;
|
||||
}
|
||||
|
||||
bool TransactionNode::dead()
|
||||
{
|
||||
return _die;
|
||||
}
|
||||
|
||||
bool TransactionNode::sleeping()
|
||||
{
|
||||
return _sleeping;
|
||||
}
|
||||
|
||||
} // namespace
|
Reference in New Issue
Block a user