mirror of
https://github.com/InoriRus/Kyty.git
synced 2026-08-28 05:06:40 +00:00
fix deadlock
This commit is contained in:
@@ -10,7 +10,9 @@ KYTY_SUBSYSTEM_DEFINE(Threads);
|
||||
|
||||
using thread_func_t = void (*)(void*);
|
||||
|
||||
// struct ThreadPrivate;
|
||||
struct ThreadPrivate;
|
||||
struct MutexPrivate;
|
||||
struct CondVarPrivate;
|
||||
class String;
|
||||
|
||||
class Thread
|
||||
@@ -25,6 +27,9 @@ public:
|
||||
// Once a thread has finished, the id may be reused by another thread.
|
||||
[[nodiscard]] String GetId() const;
|
||||
|
||||
// The id is unique and can't be reused by another thread.
|
||||
[[nodiscard]] int GetUniqueId() const;
|
||||
|
||||
static void Sleep(uint32_t millis);
|
||||
static void SleepMicro(uint32_t micros);
|
||||
static void SleepNano(uint64_t nanos);
|
||||
@@ -41,7 +46,6 @@ public:
|
||||
KYTY_CLASS_NO_COPY(Thread);
|
||||
|
||||
private:
|
||||
struct ThreadPrivate;
|
||||
ThreadPrivate* m_thread;
|
||||
};
|
||||
|
||||
@@ -60,7 +64,6 @@ public:
|
||||
KYTY_CLASS_NO_COPY(Mutex);
|
||||
|
||||
private:
|
||||
struct MutexPrivate;
|
||||
MutexPrivate* m_mutex;
|
||||
};
|
||||
|
||||
@@ -97,7 +100,6 @@ public:
|
||||
KYTY_CLASS_NO_COPY(CondVar);
|
||||
|
||||
private:
|
||||
struct CondVarPrivate;
|
||||
CondVarPrivate* m_cond_var;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user