Introduce clang-format (#240)

This commit is contained in:
Christian Semmler
2023-10-24 19:38:27 -04:00
committed by GitHub
parent e928fc9425
commit b449da1fa3
408 changed files with 12434 additions and 12813 deletions

View File

@@ -2,59 +2,57 @@
#define MXTHREAD_H
#include "compat.h"
#include "mxtypes.h"
#include "mxsemaphore.h"
#include "mxtypes.h"
class MxCore;
class MxThread
{
class MxThread {
public:
// Note: Comes before virtual destructor
virtual MxResult Run();
// Note: Comes before virtual destructor
virtual MxResult Run();
MxResult Start(int p_stack, int p_flag);
MxResult Start(int p_stack, int p_flag);
void Terminate();
void Terminate();
void Sleep(MxS32 p_milliseconds);
void Sleep(MxS32 p_milliseconds);
// Inferred, not in DLL
inline MxBool IsRunning() { return m_running; }
// Inferred, not in DLL
inline MxBool IsRunning() { return m_running; }
protected:
MxThread();
MxThread();
public:
virtual ~MxThread();
virtual ~MxThread();
private:
static unsigned ThreadProc(void *p_thread);
static unsigned ThreadProc(void* p_thread);
MxULong m_hThread;
MxU32 m_threadId;
MxBool m_running;
MxSemaphore m_semaphore;
MxULong m_hThread;
MxU32 m_threadId;
MxBool m_running;
MxSemaphore m_semaphore;
};
class MxTickleThread : public MxThread
{
class MxTickleThread : public MxThread {
public:
MxTickleThread(MxCore *p_target, int p_frequencyMS);
MxTickleThread(MxCore* p_target, int p_frequencyMS);
// Unclear at this time whether this function and the m_target field are
// actually a general "userdata" pointer in the base MxThread, but it seems
// like the only usage is with an MxTickleThread.
MxResult StartWithTarget(MxCore* p_target);
// Unclear at this time whether this function and the m_target field are
// actually a general "userdata" pointer in the base MxThread, but it seems
// like the only usage is with an MxTickleThread.
MxResult StartWithTarget(MxCore* p_target);
// Only inlined, no offset
virtual ~MxTickleThread() {}
// Only inlined, no offset
virtual ~MxTickleThread() {}
MxResult Run() override;
MxResult Run() override;
private:
MxCore *m_target;
MxS32 m_frequencyMS;
MxCore* m_target;
MxS32 m_frequencyMS;
};
#endif // MXTHREAD_H