You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
clang format apply
This commit is contained in:
@ -16,9 +16,9 @@
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/*******************************************************************************
|
||||
* $Id: we_getfilesizes.h 4450 2013-04-15 14:13:24Z chao $
|
||||
*
|
||||
*******************************************************************************/
|
||||
* $Id: we_getfilesizes.h 4450 2013-04-15 14:13:24Z chao $
|
||||
*
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <unistd.h>
|
||||
@ -30,53 +30,54 @@
|
||||
|
||||
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 processFileName(messageqcpp::ByteStream& bs, std::string& errMsg, int key);
|
||||
public:
|
||||
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() {}
|
||||
public:
|
||||
ActiveThreadCounter(int size) : factiveThreadCount(size)
|
||||
{
|
||||
}
|
||||
virtual ~ActiveThreadCounter()
|
||||
{
|
||||
}
|
||||
|
||||
void decr()
|
||||
void decr()
|
||||
{
|
||||
int atc;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
int atc;
|
||||
atomicops::atomicMb();
|
||||
atc = factiveThreadCount;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
atomicops::atomicMb();
|
||||
atc = factiveThreadCount;
|
||||
if (atc <= 0) // hopefully atc will never be < 0!
|
||||
return;
|
||||
|
||||
if (atc <= 0) //hopefully atc will never be < 0!
|
||||
return;
|
||||
if (atomicops::atomicCAS(&factiveThreadCount, atc, (atc - 1)))
|
||||
return;
|
||||
|
||||
if (atomicops::atomicCAS(&factiveThreadCount, atc, (atc - 1)))
|
||||
return;
|
||||
|
||||
atomicops::atomicYield();
|
||||
}
|
||||
atomicops::atomicYield();
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t cur()
|
||||
{
|
||||
return factiveThreadCount;
|
||||
}
|
||||
uint32_t cur()
|
||||
{
|
||||
return factiveThreadCount;
|
||||
}
|
||||
|
||||
private:
|
||||
ActiveThreadCounter(const ActiveThreadCounter& rhs);
|
||||
ActiveThreadCounter& operator=(const ActiveThreadCounter& rhs);
|
||||
private:
|
||||
ActiveThreadCounter(const ActiveThreadCounter& rhs);
|
||||
ActiveThreadCounter& operator=(const ActiveThreadCounter& rhs);
|
||||
|
||||
volatile int32_t factiveThreadCount;
|
||||
volatile int32_t factiveThreadCount;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
} // namespace WriteEngine
|
||||
|
Reference in New Issue
Block a user