thread/Thread: use C++11 initialisers
This commit is contained in:
parent
aee5966e1c
commit
fea3f6cc72
|
@ -35,11 +35,11 @@ class Error;
|
||||||
|
|
||||||
class Thread {
|
class Thread {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
HANDLE handle;
|
HANDLE handle = nullptr;
|
||||||
DWORD id;
|
DWORD id;
|
||||||
#else
|
#else
|
||||||
pthread_t handle;
|
pthread_t handle;
|
||||||
bool defined;
|
bool defined = false;
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +47,7 @@ class Thread {
|
||||||
* IsInside(), which may return false until pthread_create() has
|
* IsInside(), which may return false until pthread_create() has
|
||||||
* initialised the #handle.
|
* initialised the #handle.
|
||||||
*/
|
*/
|
||||||
bool creating;
|
bool creating = false;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -55,15 +55,7 @@ class Thread {
|
||||||
void *ctx;
|
void *ctx;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifdef WIN32
|
Thread() = default;
|
||||||
Thread():handle(nullptr) {}
|
|
||||||
#else
|
|
||||||
Thread():defined(false) {
|
|
||||||
#ifndef NDEBUG
|
|
||||||
creating = false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Thread(const Thread &) = delete;
|
Thread(const Thread &) = delete;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue