mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 10:00:28 +00:00
refactor(Core/Common): restyle common lib with astyle (#3461)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user