refactor(Core/Common): restyle common lib with astyle (#3461)

This commit is contained in:
Kargatum
2020-09-12 03:50:48 +07:00
committed by GitHub
parent e15a493927
commit 3a0b0356ac
101 changed files with 4524 additions and 4418 deletions

View File

@@ -17,18 +17,18 @@ namespace acore
{
class Runnable
{
public:
virtual ~Runnable() {}
virtual void run() = 0;
public:
virtual ~Runnable() {}
virtual void run() = 0;
void incReference() { ++m_refs; }
void decReference()
{
if (!--m_refs)
delete this;
}
private:
std::atomic_long m_refs;
void incReference() { ++m_refs; }
void decReference()
{
if (!--m_refs)
delete this;
}
private:
std::atomic_long m_refs;
};
enum Priority
@@ -44,28 +44,28 @@ namespace acore
class Thread
{
public:
Thread();
explicit Thread(Runnable* instance);
~Thread();
public:
Thread();
explicit Thread(Runnable* instance);
~Thread();
bool wait();
void destroy();
bool wait();
void destroy();
void setPriority(Priority type);
void setPriority(Priority type);
static void Sleep(unsigned long msecs);
static std::thread::id currentId();
static void Sleep(unsigned long msecs);
static std::thread::id currentId();
private:
Thread(const Thread&);
Thread& operator=(const Thread&);
private:
Thread(const Thread&);
Thread& operator=(const Thread&);
static void ThreadTask(void* param);
static void ThreadTask(void* param);
Runnable* const m_task;
std::thread::id m_iThreadId;
std::thread m_ThreadImp;
Runnable* const m_task;
std::thread::id m_iThreadId;
std::thread m_ThreadImp;
};
}
#endif