Cleaned Thread class code
Former-commit-id: d8c918c7a3c50ed3ed2f225303540d3860863d4e
This commit is contained in:
parent
465a7c246d
commit
e0229ab390
|
|
@ -22,8 +22,6 @@ class NAZARA_API NzThread : NzNonCopyable
|
||||||
friend NzThread;
|
friend NzThread;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Id() = default;
|
|
||||||
|
|
||||||
NAZARA_API friend bool operator==(const Id& lhs, const Id& rhs);
|
NAZARA_API friend bool operator==(const Id& lhs, const Id& rhs);
|
||||||
NAZARA_API friend bool operator!=(const Id& lhs, const Id& rhs);
|
NAZARA_API friend bool operator!=(const Id& lhs, const Id& rhs);
|
||||||
NAZARA_API friend bool operator<(const Id& lhs, const Id& rhs);
|
NAZARA_API friend bool operator<(const Id& lhs, const Id& rhs);
|
||||||
|
|
@ -39,7 +37,7 @@ class NAZARA_API NzThread : NzNonCopyable
|
||||||
NzThreadImpl* m_id = nullptr;
|
NzThreadImpl* m_id = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
NzThread() = default;
|
NzThread();
|
||||||
template<typename F> NzThread(F function);
|
template<typename F> NzThread(F function);
|
||||||
template<typename F, typename... Args> NzThread(F function, Args... args);
|
template<typename F, typename... Args> NzThread(F function, Args... args);
|
||||||
template<typename C> NzThread(void (C::*function)(), C* object);
|
template<typename C> NzThread(void (C::*function)(), C* object);
|
||||||
|
|
@ -59,7 +57,7 @@ class NAZARA_API NzThread : NzNonCopyable
|
||||||
private:
|
private:
|
||||||
void CreateImpl(NzFunctor* functor);
|
void CreateImpl(NzFunctor* functor);
|
||||||
|
|
||||||
NzThreadImpl* m_impl = nullptr;
|
NzThreadImpl* m_impl;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <Nazara/Core/Thread.inl>
|
#include <Nazara/Core/Thread.inl>
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@
|
||||||
// This file is part of the "Nazara Engine - Core module"
|
// This file is part of the "Nazara Engine - Core module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
// Inspiré du code de la SFML par Laurent Gomila
|
|
||||||
|
|
||||||
#include <Nazara/Core/Thread.hpp>
|
#include <Nazara/Core/Thread.hpp>
|
||||||
#include <Nazara/Core/Config.hpp>
|
#include <Nazara/Core/Config.hpp>
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
|
|
@ -20,7 +18,7 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
///********************************NzThread::Id********************************
|
/*********************************NzThread::Id********************************/
|
||||||
|
|
||||||
bool operator==(const NzThread::Id& lhs, const NzThread::Id& rhs)
|
bool operator==(const NzThread::Id& lhs, const NzThread::Id& rhs)
|
||||||
{
|
{
|
||||||
|
|
@ -63,7 +61,12 @@ m_id(thread)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
///**********************************NzThread**********************************
|
/***********************************NzThread**********************************/
|
||||||
|
|
||||||
|
NzThread::NzThread() :
|
||||||
|
m_impl(nullptr)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
NzThread::NzThread(NzThread&& other) :
|
NzThread::NzThread(NzThread&& other) :
|
||||||
m_impl(other.m_impl)
|
m_impl(other.m_impl)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue