You've already forked mariadb-columnstore-engine
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:
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user