diff options
author | ShadowNinja <ShadowNinja@users.noreply.github.com> | 2017-06-11 03:43:05 -0400 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-06-11 09:43:05 +0200 |
commit | 6c5e5e202394ce8063e3c2d9b663145bc4f8efce (patch) | |
tree | 2916ed7f7fc19c934fe5f614a9eeb1a282f13081 /src/log.cpp | |
parent | 5cc8ad946efb3612eb6ea8655780b29fe4c62e19 (diff) | |
download | minetest-6c5e5e202394ce8063e3c2d9b663145bc4f8efce.tar.gz minetest-6c5e5e202394ce8063e3c2d9b663145bc4f8efce.tar.bz2 minetest-6c5e5e202394ce8063e3c2d9b663145bc4f8efce.zip |
Remove threads.h and replace its definitions with their C++11 equivalents (#5957)
This also changes threadProc's signature, since C++11 supports arbitrary
thread function signatures.
Diffstat (limited to 'src/log.cpp')
-rw-r--r-- | src/log.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/log.cpp b/src/log.cpp index 589cfd909..28118066f 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -223,14 +223,14 @@ void Logger::setLevelSilenced(LogLevel lev, bool silenced) void Logger::registerThread(const std::string &name) { - threadid_t id = thr_get_current_thread_id(); + std::thread::id id = std::this_thread::get_id(); MutexAutoLock lock(m_mutex); m_thread_names[id] = name; } void Logger::deregisterThread() { - threadid_t id = thr_get_current_thread_id(); + std::thread::id id = std::this_thread::get_id(); MutexAutoLock lock(m_mutex); m_thread_names.erase(id); } @@ -253,9 +253,9 @@ const std::string Logger::getLevelLabel(LogLevel lev) const std::string Logger::getThreadName() { - std::map<threadid_t, std::string>::const_iterator it; + std::map<std::thread::id, std::string>::const_iterator it; - threadid_t id = thr_get_current_thread_id(); + std::thread::id id = std::this_thread::get_id(); it = m_thread_names.find(id); if (it != m_thread_names.end()) return it->second; |