diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2011-01-27 20:47:58 +0000 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2011-01-27 20:47:58 +0000 |
| commit | 2c05c49a04aa838047417825c289958efb59ee3c (patch) | |
| tree | 2731699f2223276c60b6b403d3a080d75f99bf74 /Source/Core/DolphinWX/Src/NetPlayClient.cpp | |
| parent | 0371f15c23bf9fb64941e3adbc72b80f955e2ff5 (diff) | |
Replaced Common::Thread with a partial implementation of std::thread. (rvalue references are used if available, <thread> is used if possible) Eliminates the need to use dynamic memory allocation for threads, so it's impossible to forget to delete a thread or set a pointer to NULL. Enables use of type-safe thread functions, no need to cast to and from void*. I've made sure the code compiles in vs08 and tested the functionality of "StdThread.h" on Linux so I'm hoping everything will work :p. In the future "StdThread.h" can be removed (maybe when OS X ships with gcc 4.4 and vs2015 is released :p).
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6933 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DolphinWX/Src/NetPlayClient.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Src/NetPlayClient.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/Core/DolphinWX/Src/NetPlayClient.cpp b/Source/Core/DolphinWX/Src/NetPlayClient.cpp index a685d1ee4f..639dee80ef 100644 --- a/Source/Core/DolphinWX/Src/NetPlayClient.cpp +++ b/Source/Core/DolphinWX/Src/NetPlayClient.cpp @@ -7,8 +7,7 @@ NetPlayClient::~NetPlayClient() if (is_connected) { m_do_loop = false; - m_thread->WaitForDeath(); - delete m_thread; + m_thread.join(); } } @@ -73,7 +72,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s is_connected = true; m_selector.Add(m_socket); - m_thread = new Common::Thread(NetPlayThreadFunc, this); + m_thread = std::thread(NetPlayThreadFunc, this); } } else |
