1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -29,48 +29,54 @@
#include "atomicops.h"
namespace WriteEngine {
namespace WriteEngine
{
/** @brief Get all file sizes for the given table
*/
class WE_GetFileSizes
{
public:
static int processTable(messageqcpp::ByteStream& bs, std::string& errMsg, int key);
static int processTable(messageqcpp::ByteStream& bs, std::string& errMsg, int key);
static int processFileName(messageqcpp::ByteStream& bs, std::string& errMsg, int key);
};
class ActiveThreadCounter
{
public:
ActiveThreadCounter(int size) : factiveThreadCount(size){}
virtual ~ActiveThreadCounter() {}
ActiveThreadCounter(int size) : factiveThreadCount(size) {}
virtual ~ActiveThreadCounter() {}
void decr()
{
int atc;
for (;;) {
atomicops::atomicMb();
atc = factiveThreadCount;
if (atc <= 0) //hopefully atc will never be < 0!
return;
if (atomicops::atomicCAS(&factiveThreadCount, atc, (atc - 1)))
return;
atomicops::atomicYield();
}
}
void decr()
{
int atc;
uint32_t cur()
{
return factiveThreadCount;
}
for (;;)
{
atomicops::atomicMb();
atc = factiveThreadCount;
if (atc <= 0) //hopefully atc will never be < 0!
return;
if (atomicops::atomicCAS(&factiveThreadCount, atc, (atc - 1)))
return;
atomicops::atomicYield();
}
}
uint32_t cur()
{
return factiveThreadCount;
}
private:
ActiveThreadCounter(const ActiveThreadCounter& rhs);
ActiveThreadCounter& operator=(const ActiveThreadCounter& rhs);
ActiveThreadCounter(const ActiveThreadCounter& rhs);
ActiveThreadCounter& operator=(const ActiveThreadCounter& rhs);
volatile int32_t factiveThreadCount;
volatile int32_t factiveThreadCount;
};
}